@@ -77,6 +77,8 @@ select @@gtid_binlog_state;
77
77
78
78
--echo cluster 2 node 1
79
79
--connection node_4
80
+ --let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
81
+ --source include/wait_condition.inc
80
82
select @@gtid_binlog_state;
81
83
insert into t1 values (2, 21, 1);
82
84
select @@gtid_binlog_state;
@@ -85,11 +87,16 @@ select @@gtid_binlog_state;
85
87
--source include/save_master_gtid.inc
86
88
--connection node_4
87
89
--source include/sync_with_master_gtid.inc
90
+ --let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
91
+ --source include/wait_condition.inc
88
92
select * from t1 order by 1, 2, 3;
89
93
90
94
91
95
--echo cluster 1 node 2
92
96
--connection node_2
97
+ --let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
98
+ --source include/wait_condition.inc
99
+
93
100
select @@gtid_binlog_state;
94
101
insert into t1 values (1, 12, 3);
95
102
select @@gtid_binlog_state;
@@ -99,10 +106,14 @@ select @@gtid_binlog_state;
99
106
--source include/save_master_gtid.inc
100
107
--connection node_4
101
108
--source include/sync_with_master_gtid.inc
109
+ --let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
110
+ --source include/wait_condition.inc
102
111
select * from t1 order by 1, 2, 3;
103
112
104
113
--echo cluster 1 node 3
105
114
--connection node_3
115
+ --let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
116
+ --source include/wait_condition.inc
106
117
select @@gtid_binlog_state;
107
118
insert into t1 values (1, 13, 4);
108
119
select @@gtid_binlog_state;
@@ -112,10 +123,14 @@ select @@gtid_binlog_state;
112
123
--source include/save_master_gtid.inc
113
124
--connection node_4
114
125
--source include/sync_with_master_gtid.inc
126
+ --let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
127
+ --source include/wait_condition.inc
115
128
select * from t1 order by 1, 2, 3;
116
129
117
130
--echo cluster 2 node 2
118
131
--connection node_5
132
+ --let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
133
+ --source include/wait_condition.inc
119
134
select @@gtid_binlog_state;
120
135
insert into t1 values (2, 22, 2);
121
136
select @@gtid_binlog_state;
@@ -125,37 +140,55 @@ select @@gtid_binlog_state;
125
140
--source include/save_master_gtid.inc
126
141
--connection node_1
127
142
--source include/sync_with_master_gtid.inc
143
+ --let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
144
+ --source include/wait_condition.inc
128
145
select * from t1 order by 1, 2, 3;
129
146
130
147
--echo cluster 2 node 3
131
148
--connection node_6
149
+ --let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
150
+ --source include/wait_condition.inc
132
151
select @@gtid_binlog_state;
133
152
insert into t1 values (2, 23, 3);
134
153
select @@gtid_binlog_state;
135
154
136
155
--echo #wait for sync cluster 2 and 1
137
156
--connection node_4
157
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
158
+ --source include/wait_condition.inc
138
159
--source include/save_master_gtid.inc
139
160
--connection node_1
140
161
--source include/sync_with_master_gtid.inc
162
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
163
+ --source include/wait_condition.inc
141
164
select * from t1 order by 1, 2, 3;
142
165
143
166
--echo # check other nodes are consistent
144
167
--connection node_2
168
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
169
+ --source include/wait_condition.inc
145
170
select @@gtid_binlog_state;
146
171
select * from t1 order by 1, 2, 3;
147
172
--connection node_3
173
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
174
+ --source include/wait_condition.inc
148
175
select @@gtid_binlog_state;
149
176
select * from t1 order by 1, 2, 3;
150
177
--connection node_5
178
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
179
+ --source include/wait_condition.inc
151
180
select @@gtid_binlog_state;
152
181
select * from t1 order by 1, 2, 3;
153
182
--connection node_6
183
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
184
+ --source include/wait_condition.inc
154
185
select @@gtid_binlog_state;
155
186
select * from t1 order by 1, 2, 3;
156
187
157
188
--echo cluster 1 node 1
158
189
--connection node_1
190
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
191
+ --source include/wait_condition.inc
159
192
select @@gtid_binlog_state;
160
193
drop table t1;
161
194
stop slave;
@@ -250,6 +283,8 @@ select @@gtid_binlog_state;
250
283
--sleep 2
251
284
--echo cluster 2 node 1
252
285
--connection node_4
286
+ --let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
287
+ --source include/wait_condition.inc
253
288
insert into t1 values (2, 21, 1);
254
289
select @@gtid_binlog_state;
255
290
@@ -258,11 +293,16 @@ select @@gtid_binlog_state;
258
293
--source include/save_master_gtid.inc
259
294
--connection node_4
260
295
--source include/sync_with_master_gtid.inc
296
+ --let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
297
+ --source include/wait_condition.inc
298
+
261
299
select * from t1 order by 1, 2, 3;
262
300
263
301
264
302
--echo cluster 1 node 2
265
303
--connection node_2
304
+ --let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
305
+ --source include/wait_condition.inc
266
306
select @@gtid_binlog_state;
267
307
insert into t1 values (1, 12, 3);
268
308
select @@gtid_binlog_state;
@@ -272,10 +312,14 @@ select @@gtid_binlog_state;
272
312
--source include/save_master_gtid.inc
273
313
--connection node_4
274
314
--source include/sync_with_master_gtid.inc
315
+ --let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
316
+ --source include/wait_condition.inc
275
317
select * from t1 order by 1, 2, 3;
276
318
277
319
--echo cluster 1 node 3
278
320
--connection node_3
321
+ --let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
322
+ --source include/wait_condition.inc
279
323
select @@gtid_binlog_state;
280
324
insert into t1 values (1, 13, 4);
281
325
select @@gtid_binlog_state;
@@ -285,10 +329,14 @@ select @@gtid_binlog_state;
285
329
--source include/save_master_gtid.inc
286
330
--connection node_4
287
331
--source include/sync_with_master_gtid.inc
332
+ --let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
333
+ --source include/wait_condition.inc
288
334
select * from t1 order by 1, 2, 3;
289
335
290
336
--echo cluster 2 node 2
291
337
--connection node_5
338
+ --let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
339
+ --source include/wait_condition.inc
292
340
select @@gtid_binlog_state;
293
341
insert into t1 values (2, 22, 2);
294
342
select @@gtid_binlog_state;
@@ -298,10 +346,14 @@ select @@gtid_binlog_state;
298
346
--source include/save_master_gtid.inc
299
347
--connection node_1
300
348
--source include/sync_with_master_gtid.inc
349
+ --let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
350
+ --source include/wait_condition.inc
301
351
select * from t1 order by 1, 2, 3;
302
352
303
353
--echo cluster 2 node 3
304
354
--connection node_6
355
+ --let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
356
+ --source include/wait_condition.inc
305
357
select @@gtid_binlog_state;
306
358
insert into t1 values (2, 23, 3);
307
359
select @@gtid_binlog_state;
@@ -311,24 +363,36 @@ select @@gtid_binlog_state;
311
363
--source include/save_master_gtid.inc
312
364
--connection node_1
313
365
--source include/sync_with_master_gtid.inc
366
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
367
+ --source include/wait_condition.inc
314
368
select * from t1 order by 1, 2, 3;
315
369
316
370
--echo # check other nodes are consistent
317
371
--connection node_2
372
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
373
+ --source include/wait_condition.inc
318
374
select @@gtid_binlog_state;
319
375
select * from t1 order by 1, 2, 3;
320
376
--connection node_3
377
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
378
+ --source include/wait_condition.inc
321
379
select @@gtid_binlog_state;
322
380
select * from t1 order by 1, 2, 3;
323
381
--connection node_5
382
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
383
+ --source include/wait_condition.inc
324
384
select @@gtid_binlog_state;
325
385
select * from t1 order by 1, 2, 3;
326
386
--connection node_6
387
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
388
+ --source include/wait_condition.inc
327
389
select @@gtid_binlog_state;
328
390
select * from t1 order by 1, 2, 3;
329
391
330
392
--echo cluster 1 node 1
331
393
--connection node_1
394
+ --let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
395
+ --source include/wait_condition.inc
332
396
select @@gtid_binlog_state;
333
397
drop table t1;
334
398
stop slave;
0 commit comments