Debian Codegraph @

mysql-test/suite/group_replication/r/gr_savepoint.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6 [connection server1]
7 CREATE TABLE t1(a int primary key);
8 #
9 # Don't cause conflict due the rollback
10 #
11
12 ############################################################
13 # 0. Initial setup and checks.
14 [connection server1]
15 SET SESSION sql_log_bin= 0;
16 include/gtid_utils.inc
17 SET SESSION sql_log_bin= 1;
18 include/gtid_step_reset.inc
19
20 ############################################################
21 # 1. Set a debug sync before broadcast message to group on
22 # connection local_server_connection1.
23 [connection server1]
24 SET @debug_save= @@GLOBAL.DEBUG;
25 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
26
27 #####################################################################
28 # 2. Commit local_transaction that will be blocked before broadcast.
29 BEGIN;
30 INSERT INTO t1 VALUES(1); SAVEPOINT A; INSERT INTO t1 values(2); ROLLBACK TO A; RELEASE SAVEPOINT A;
31 COMMIT;
32
33 ############################################################
34 # 3. Wait until local transaction reaches the
35 # group_replication_before_message_broadcast debug sync point.
36 [connection server_1]
37
38 ############################################################
39 # 4. Execute a transaction on remote server, that will reach first
40 # certification, since transaction on the local server
41 # is blocked before broadcast.
42 [connection server2]
43 BEGIN;
44 INSERT INTO t1 VALUES (2);
45 COMMIT;
46
47 ############################################################
48 # 5. Signal the waiting thread on local server to resume the
49 # transaction.
50 [connection server_1]
51 SET DEBUG_SYNC='now SIGNAL waiting';
52 SET @@GLOBAL.DEBUG= @debug_save;
53
54 ############################################################
55 # 6. Wait for remote transaction to be executed succesfully
56 on local server.
57 [connection server2]
58 include/sync_slave_sql_with_master.inc
59 ############################################################
60 # 7. If the test case is conflict scenario, local transaction
61 # will end up in an error stating that it was aborted,
62 # since transactions are conflicting and transaction on
63 # remote server was ordered first. If the test case is
64 # is positive scenario, no error will be seen here.
65 [connection server1]
66 [connection server1]
67 SET @@GLOBAL.DEBUG=@debug_save;
68 ############################################################
69 # 8. Sync everything
70 include/rpl_sync.inc
71 ############################################################
72 # 9. Assert that number of certified transactions are the
73 # expected ones.
74 include/assert.inc [The value of Count_Transactions_Checked should be 3 after starting group replication]
75 include/assert.inc [The value of Count_Conflicts_Detected should be 0 after starting group replication]
76 ############################################################
77 # 10. Assert that GTID is increased as expected
78 include/gtid_step_assert.inc [count=2, only_count=1]
79 [connection server1]
80 SET SESSION sql_log_bin= 0;
81 include/gtid_utils_end.inc
82 SET SESSION sql_log_bin= 1;
83 ############################################################
84 # 11. Cleanup (restore the connection back to original)
85 [connection server1]
86 include/assert.inc ['Table t1 has values 1 and 2']
87 #
88 # Don't cause conflict due the rollback and the release don't interfere
89 #
90
91 ############################################################
92 # 0. Initial setup and checks.
93 [connection server1]
94 SET SESSION sql_log_bin= 0;
95 include/gtid_utils.inc
96 SET SESSION sql_log_bin= 1;
97 include/gtid_step_reset.inc
98
99 ############################################################
100 # 1. Set a debug sync before broadcast message to group on
101 # connection local_server_connection1.
102 [connection server1]
103 SET @debug_save= @@GLOBAL.DEBUG;
104 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
105
106 #####################################################################
107 # 2. Commit local_transaction that will be blocked before broadcast.
108 BEGIN;
109 INSERT INTO t1 VALUES(3); SAVEPOINT A; INSERT INTO t1 values(4); ROLLBACK TO A;
110 COMMIT;
111
112 ############################################################
113 # 3. Wait until local transaction reaches the
114 # group_replication_before_message_broadcast debug sync point.
115 [connection server_1]
116
117 ############################################################
118 # 4. Execute a transaction on remote server, that will reach first
119 # certification, since transaction on the local server
120 # is blocked before broadcast.
121 [connection server2]
122 BEGIN;
123 INSERT INTO t1 VALUES (4);
124 COMMIT;
125
126 ############################################################
127 # 5. Signal the waiting thread on local server to resume the
128 # transaction.
129 [connection server_1]
130 SET DEBUG_SYNC='now SIGNAL waiting';
131 SET @@GLOBAL.DEBUG= @debug_save;
132
133 ############################################################
134 # 6. Wait for remote transaction to be executed succesfully
135 on local server.
136 [connection server2]
137 include/sync_slave_sql_with_master.inc
138 ############################################################
139 # 7. If the test case is conflict scenario, local transaction
140 # will end up in an error stating that it was aborted,
141 # since transactions are conflicting and transaction on
142 # remote server was ordered first. If the test case is
143 # is positive scenario, no error will be seen here.
144 [connection server1]
145 [connection server1]
146 SET @@GLOBAL.DEBUG=@debug_save;
147 ############################################################
148 # 8. Sync everything
149 include/rpl_sync.inc
150 ############################################################
151 # 9. Assert that number of certified transactions are the
152 # expected ones.
153 include/assert.inc [The value of Count_Transactions_Checked should be 5 after starting group replication]
154 include/assert.inc [The value of Count_Conflicts_Detected should be 0 after starting group replication]
155 ############################################################
156 # 10. Assert that GTID is increased as expected
157 include/gtid_step_assert.inc [count=2, only_count=1]
158 [connection server1]
159 SET SESSION sql_log_bin= 0;
160 include/gtid_utils_end.inc
161 SET SESSION sql_log_bin= 1;
162 ############################################################
163 # 11. Cleanup (restore the connection back to original)
164 [connection server1]
165 include/assert.inc ['Table t1 has values 3 and 4']
166 #
167 # Using SAVEPOINT don't modify the conflict detection
168 #
169
170 ############################################################
171 # 0. Initial setup and checks.
172 [connection server1]
173 SET SESSION sql_log_bin= 0;
174 include/gtid_utils.inc
175 SET SESSION sql_log_bin= 1;
176 include/gtid_step_reset.inc
177
178 ############################################################
179 # 1. Set a debug sync before broadcast message to group on
180 # connection local_server_connection1.
181 [connection server1]
182 SET @debug_save= @@GLOBAL.DEBUG;
183 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
184
185 #####################################################################
186 # 2. Commit local_transaction that will be blocked before broadcast.
187 BEGIN;
188 INSERT INTO t1 VALUES(5); SAVEPOINT A; INSERT INTO t1 values(6);
189 COMMIT;
190
191 ############################################################
192 # 3. Wait until local transaction reaches the
193 # group_replication_before_message_broadcast debug sync point.
194 [connection server_1]
195
196 ############################################################
197 # 4. Execute a transaction on remote server, that will reach first
198 # certification, since transaction on the local server
199 # is blocked before broadcast.
200 [connection server2]
201 BEGIN;
202 INSERT INTO t1 VALUES (6); INSERT INTO t1 VALUES(7);
203 COMMIT;
204
205 ############################################################
206 # 5. Signal the waiting thread on local server to resume the
207 # transaction.
208 [connection server_1]
209 SET DEBUG_SYNC='now SIGNAL waiting';
210 SET @@GLOBAL.DEBUG= @debug_save;
211
212 ############################################################
213 # 6. Wait for remote transaction to be executed succesfully
214 on local server.
215 [connection server2]
216 include/sync_slave_sql_with_master.inc
217 ############################################################
218 # 7. If the test case is conflict scenario, local transaction
219 # will end up in an error stating that it was aborted,
220 # since transactions are conflicting and transaction on
221 # remote server was ordered first. If the test case is
222 # is positive scenario, no error will be seen here.
223 [connection server1]
224 ERROR 40000: Plugin instructed the server to rollback the current transaction.
225 [connection server1]
226 SET @@GLOBAL.DEBUG=@debug_save;
227 ############################################################
228 # 8. Sync everything
229 include/rpl_sync.inc
230 ############################################################
231 # 9. Assert that number of certified transactions are the
232 # expected ones.
233 include/assert.inc [The value of Count_Transactions_Checked should be 7 after starting group replication]
234 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
235 ############################################################
236 # 10. Assert that GTID is increased as expected
237 include/gtid_step_assert.inc [count=1, only_count=1]
238 [connection server1]
239 SET SESSION sql_log_bin= 0;
240 include/gtid_utils_end.inc
241 SET SESSION sql_log_bin= 1;
242 ############################################################
243 # 11. Cleanup (restore the connection back to original)
244 [connection server1]
245 include/assert.inc ['There are six values in table t1']
246 include/assert.inc ['Table t1 has values 6 and 7']
247 include/assert.inc ['Table t1 do not have value 5']
248 DROP TABLE t1;
249 include/group_replication_end.inc