Debian Codegraph @

mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test

raw
1 #
2 # Tests handling of several configuration changes while a joiner gets
3 # state transfer
4 #
5 # Variant A: sending of state transfer request delayed until two more
6 # primary configuration changes happen
7 #
8 # Refs codersihp/galera-bugs#454
9 #
10 --source include/have_innodb.inc
11 --source include/galera_cluster.inc
12 --source include/galera_have_debug_sync.inc
13
14 --let $galera_connection_name = node_3
15 --let $galera_server_number = 3
16 --source include/galera_connect.inc
17
18 # Save original auto_increment_offset values.
19 --let $node_1=node_1
20 --let $node_2=node_2
21 --let $node_3=node_3
22 --source ../galera/include/auto_increment_offset_save.inc
23
24 --connection node_1
25 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
26 --source include/wait_condition.inc
27
28 CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
29 INSERT INTO t1 VALUES (1, 1);
30
31 --connection node_2
32 --let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
33 --source include/wait_condition.inc
34
35 #
36 # Isolate node_1 and update cluster state to force node 1 into joiner mode
37 #
38 --connection node_1
39 SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
40
41 --connection node_2
42 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
43 --source include/wait_condition.inc
44
45 --connection node_3
46 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
47 --source include/wait_condition.inc
48
49 INSERT INTO t1 VALUES (2, 3);
50
51 --connection node_2
52 --let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
53 --source include/wait_condition.inc
54
55 #
56 # Now reconnect node_1 but first make it block before sending state transfer
57 # request
58 #
59 # THIS IS PC1
60 #
61 --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
62 SET wsrep_sync_wait = 0;
63 SET wsrep_on = OFF;
64 --let $galera_sync_point = after_shift_to_joining
65 --source include/galera_set_sync_point.inc
66
67 --connection node_1
68 SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
69
70 --connection node_2
71 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
72 --source include/wait_condition.inc
73
74 INSERT INTO t1 VALUES (3, 2);
75
76 --connection node_1a
77 --source include/galera_wait_sync_point.inc
78 #
79 # At this point every node thinks that node_1 is in a JOINER state
80 #
81
82 --connection node_3
83 --let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
84 --source include/wait_condition.inc
85
86 #
87 # Now that node_1 sent state request and became JOINER isolate node_1 again
88 # and commit one more action, so that node_1 loses JOINER state
89 #
90 --connection node_1
91 SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
92
93 --connection node_2
94 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
95 --source include/wait_condition.inc
96
97 --connection node_3
98 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
99 --source include/wait_condition.inc
100
101 INSERT INTO t1 VALUES (4, 3);
102
103 --connection node_2
104 --let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
105 --source include/wait_condition.inc
106
107 #
108 # Reconnect node_1 again
109 #
110 # THIS IS PC2
111 #
112 --connection node_1
113 SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
114
115 --connection node_2
116 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
117 --source include/wait_condition.inc
118 #
119 # After this point node_1 is no longer JOINER and is required to start the
120 # whole procedure over because it missed some actions (4th insert into t1)
121 #
122
123 INSERT INTO t1 VALUES (5, 2);
124
125 --connection node_3
126 --let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
127 --source include/wait_condition.inc
128
129 #
130 # Now let node_1 continue with IST and finish processing PC1, but make it
131 # block when processing PC2 just before sending state transfer request
132 #
133 --connection node_1a
134 --let $galera_sync_point = before_send_state_request
135 --source include/galera_set_sync_point.inc
136 --let $galera_sync_point = after_shift_to_joining
137 --source include/galera_signal_sync_point.inc
138 --let $galera_sync_point = before_send_state_request
139 --source include/galera_wait_sync_point.inc
140
141 # since PC1 has been processed node_1 must have 3 rows in t1
142 # 2 were there before PC1 and one was added while in PC1
143 --let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
144 --source include/wait_condition.inc
145
146 #
147 # Now disconnect and reconnect node_1 again to get PC3
148 # It still is blocked before sending state transfer request in PC2.
149 #
150 --connection node_1
151 SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
152
153 --connection node_2
154 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
155 --source include/wait_condition.inc
156
157 --connection node_3
158 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
159 --source include/wait_condition.inc
160
161 INSERT INTO t1 VALUES (6, 3);
162
163 --connection node_2
164 --let $wait_condition = SELECT COUNT(*) = 6 FROM t1;
165 --source include/wait_condition.inc
166
167 --connection node_1
168 SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
169
170 --connection node_2
171 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
172 --source include/wait_condition.inc
173 #
174 # This is PC3
175 #
176
177 INSERT INTO t1 VALUES (7, 2);
178
179 --connection node_3
180 --let $wait_condition = SELECT COUNT(*) = 7 FROM t1;
181 --source include/wait_condition.inc
182
183 #
184 # Now disconnect and reconnect node_1 again to get PC4 and allow node_1
185 # to send state transfer request to be delivered in PC4 (and thus get
186 # updated to PC4 seqno in state transfer.
187 # Note that node_1 still processes PC2.
188 #
189 --connection node_1
190 SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
191
192 --connection node_2
193 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
194 --source include/wait_condition.inc
195
196 --connection node_3
197 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
198 --source include/wait_condition.inc
199
200 INSERT INTO t1 VALUES (8, 3);
201
202 --connection node_2
203 --let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
204 --source include/wait_condition.inc
205
206 --connection node_1
207 SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
208
209 --connection node_2
210 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
211 --source include/wait_condition.inc
212 #
213 # This is PC4. node_1 is still processing PC2, waiting to send state trasfer
214 # request
215 #
216 --connection node_1a
217 --let $galera_sync_point = process_primary_configuration
218 --source include/galera_set_sync_point.inc
219 --let $galera_sync_point = before_send_state_request
220 --source include/galera_signal_sync_point.inc
221 # sent STR from PC2 into PC4
222
223 --let $galera_sync_point = process_primary_configuration
224 --source include/galera_wait_sync_point.inc
225 #
226 # Now node_1 is processing PC3, but should have completed state transfer from
227 # PC4 and thus must have 8 rows in t1
228 #
229 --let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
230 --source include/wait_condition.inc
231
232 --connection node_2
233 INSERT INTO t1 VALUES (9, 2);
234
235 --connection node_3
236 --let $wait_condition = SELECT COUNT(*) = 9 FROM t1;
237 --source include/wait_condition.inc
238
239 --connection node_1a
240 #--let $galera_sync_point = process_primary_configuration
241 --source include/galera_signal_sync_point.inc
242 --source include/galera_wait_sync_point.inc
243 #
244 # Now node_1 is processing PC4, still must have 8 rows in t1
245 #
246 --let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
247 --source include/wait_condition.inc
248
249 #--let $galera_sync_point = process_primary_configuration
250 --source include/galera_signal_sync_point.inc
251 --source include/galera_clear_sync_point.inc
252
253 --let $wait_condition = SELECT COUNT(*) = 9 FROM t1;
254 --source include/wait_condition.inc
255
256 --connection node_1
257 --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
258 --source include/wait_condition.inc
259
260 DROP TABLE t1;
261
262 call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\.");
263
264 --connection node_2
265 call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\.");
266
267 --connection node_3
268 call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\.");
269
270 --source ../galera/include/auto_increment_offset_restore.inc