Skip to content

Commit ee947fa

Browse files
janlindstromsysprg
authored andcommitted
MDEV-36464 : Galera test failure on galera_3nodes.galera_gtid_2_cluster
Test changes only. Add wait conditions after INSERT-clauses to make sure that they are replicated before checking gtid position or table contents. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
1 parent 0403f01 commit ee947fa

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ select @@gtid_binlog_state;
7777

7878
--echo cluster 2 node 1
7979
--connection node_4
80+
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
81+
--source include/wait_condition.inc
8082
select @@gtid_binlog_state;
8183
insert into t1 values (2, 21, 1);
8284
select @@gtid_binlog_state;
@@ -85,11 +87,16 @@ select @@gtid_binlog_state;
8587
--source include/save_master_gtid.inc
8688
--connection node_4
8789
--source include/sync_with_master_gtid.inc
90+
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
91+
--source include/wait_condition.inc
8892
select * from t1 order by 1, 2, 3;
8993

9094

9195
--echo cluster 1 node 2
9296
--connection node_2
97+
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
98+
--source include/wait_condition.inc
99+
93100
select @@gtid_binlog_state;
94101
insert into t1 values (1, 12, 3);
95102
select @@gtid_binlog_state;
@@ -99,10 +106,14 @@ select @@gtid_binlog_state;
99106
--source include/save_master_gtid.inc
100107
--connection node_4
101108
--source include/sync_with_master_gtid.inc
109+
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
110+
--source include/wait_condition.inc
102111
select * from t1 order by 1, 2, 3;
103112

104113
--echo cluster 1 node 3
105114
--connection node_3
115+
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
116+
--source include/wait_condition.inc
106117
select @@gtid_binlog_state;
107118
insert into t1 values (1, 13, 4);
108119
select @@gtid_binlog_state;
@@ -112,10 +123,14 @@ select @@gtid_binlog_state;
112123
--source include/save_master_gtid.inc
113124
--connection node_4
114125
--source include/sync_with_master_gtid.inc
126+
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
127+
--source include/wait_condition.inc
115128
select * from t1 order by 1, 2, 3;
116129

117130
--echo cluster 2 node 2
118131
--connection node_5
132+
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
133+
--source include/wait_condition.inc
119134
select @@gtid_binlog_state;
120135
insert into t1 values (2, 22, 2);
121136
select @@gtid_binlog_state;
@@ -125,37 +140,55 @@ select @@gtid_binlog_state;
125140
--source include/save_master_gtid.inc
126141
--connection node_1
127142
--source include/sync_with_master_gtid.inc
143+
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
144+
--source include/wait_condition.inc
128145
select * from t1 order by 1, 2, 3;
129146

130147
--echo cluster 2 node 3
131148
--connection node_6
149+
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
150+
--source include/wait_condition.inc
132151
select @@gtid_binlog_state;
133152
insert into t1 values (2, 23, 3);
134153
select @@gtid_binlog_state;
135154

136155
--echo #wait for sync cluster 2 and 1
137156
--connection node_4
157+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
158+
--source include/wait_condition.inc
138159
--source include/save_master_gtid.inc
139160
--connection node_1
140161
--source include/sync_with_master_gtid.inc
162+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
163+
--source include/wait_condition.inc
141164
select * from t1 order by 1, 2, 3;
142165

143166
--echo # check other nodes are consistent
144167
--connection node_2
168+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
169+
--source include/wait_condition.inc
145170
select @@gtid_binlog_state;
146171
select * from t1 order by 1, 2, 3;
147172
--connection node_3
173+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
174+
--source include/wait_condition.inc
148175
select @@gtid_binlog_state;
149176
select * from t1 order by 1, 2, 3;
150177
--connection node_5
178+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
179+
--source include/wait_condition.inc
151180
select @@gtid_binlog_state;
152181
select * from t1 order by 1, 2, 3;
153182
--connection node_6
183+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
184+
--source include/wait_condition.inc
154185
select @@gtid_binlog_state;
155186
select * from t1 order by 1, 2, 3;
156187

157188
--echo cluster 1 node 1
158189
--connection node_1
190+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
191+
--source include/wait_condition.inc
159192
select @@gtid_binlog_state;
160193
drop table t1;
161194
stop slave;
@@ -250,6 +283,8 @@ select @@gtid_binlog_state;
250283
--sleep 2
251284
--echo cluster 2 node 1
252285
--connection node_4
286+
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
287+
--source include/wait_condition.inc
253288
insert into t1 values (2, 21, 1);
254289
select @@gtid_binlog_state;
255290

@@ -258,11 +293,16 @@ select @@gtid_binlog_state;
258293
--source include/save_master_gtid.inc
259294
--connection node_4
260295
--source include/sync_with_master_gtid.inc
296+
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
297+
--source include/wait_condition.inc
298+
261299
select * from t1 order by 1, 2, 3;
262300

263301

264302
--echo cluster 1 node 2
265303
--connection node_2
304+
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
305+
--source include/wait_condition.inc
266306
select @@gtid_binlog_state;
267307
insert into t1 values (1, 12, 3);
268308
select @@gtid_binlog_state;
@@ -272,10 +312,14 @@ select @@gtid_binlog_state;
272312
--source include/save_master_gtid.inc
273313
--connection node_4
274314
--source include/sync_with_master_gtid.inc
315+
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
316+
--source include/wait_condition.inc
275317
select * from t1 order by 1, 2, 3;
276318

277319
--echo cluster 1 node 3
278320
--connection node_3
321+
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
322+
--source include/wait_condition.inc
279323
select @@gtid_binlog_state;
280324
insert into t1 values (1, 13, 4);
281325
select @@gtid_binlog_state;
@@ -285,10 +329,14 @@ select @@gtid_binlog_state;
285329
--source include/save_master_gtid.inc
286330
--connection node_4
287331
--source include/sync_with_master_gtid.inc
332+
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
333+
--source include/wait_condition.inc
288334
select * from t1 order by 1, 2, 3;
289335

290336
--echo cluster 2 node 2
291337
--connection node_5
338+
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
339+
--source include/wait_condition.inc
292340
select @@gtid_binlog_state;
293341
insert into t1 values (2, 22, 2);
294342
select @@gtid_binlog_state;
@@ -298,10 +346,14 @@ select @@gtid_binlog_state;
298346
--source include/save_master_gtid.inc
299347
--connection node_1
300348
--source include/sync_with_master_gtid.inc
349+
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
350+
--source include/wait_condition.inc
301351
select * from t1 order by 1, 2, 3;
302352

303353
--echo cluster 2 node 3
304354
--connection node_6
355+
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
356+
--source include/wait_condition.inc
305357
select @@gtid_binlog_state;
306358
insert into t1 values (2, 23, 3);
307359
select @@gtid_binlog_state;
@@ -311,24 +363,36 @@ select @@gtid_binlog_state;
311363
--source include/save_master_gtid.inc
312364
--connection node_1
313365
--source include/sync_with_master_gtid.inc
366+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
367+
--source include/wait_condition.inc
314368
select * from t1 order by 1, 2, 3;
315369

316370
--echo # check other nodes are consistent
317371
--connection node_2
372+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
373+
--source include/wait_condition.inc
318374
select @@gtid_binlog_state;
319375
select * from t1 order by 1, 2, 3;
320376
--connection node_3
377+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
378+
--source include/wait_condition.inc
321379
select @@gtid_binlog_state;
322380
select * from t1 order by 1, 2, 3;
323381
--connection node_5
382+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
383+
--source include/wait_condition.inc
324384
select @@gtid_binlog_state;
325385
select * from t1 order by 1, 2, 3;
326386
--connection node_6
387+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
388+
--source include/wait_condition.inc
327389
select @@gtid_binlog_state;
328390
select * from t1 order by 1, 2, 3;
329391

330392
--echo cluster 1 node 1
331393
--connection node_1
394+
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
395+
--source include/wait_condition.inc
332396
select @@gtid_binlog_state;
333397
drop table t1;
334398
stop slave;

0 commit comments

Comments
 (0)