Skip to content

Commit ddc9833

Browse files
mkaruzaJan Lindström
authored andcommitted
Fix for galera_3nodes.galera_gtid_2_cluster
Temporary disable WSREP while executing RESET MASTER. In situation when 2 nodes are both master/slave first stop slave on both and than reset master. Enforce stricter causality check with wsrep_sync_wait.
1 parent baed663 commit ddc9833

File tree

4 files changed

+129
-6
lines changed

4 files changed

+129
-6
lines changed

mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ gtid_ignore_duplicates
1313
wsrep-provider=@ENV.WSREP_PROVIDER
1414
wsrep_node_address=127.0.0.1
1515
# enforce read-committed characteristics across the cluster
16-
# wsrep-causal-reads=ON
17-
# wsrep-sync-wait=15
16+
wsrep-sync-wait=15
1817

1918
[mysqld.1]
2019
#galera_port=@OPT.port

mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
1+
connection node_2;
2+
connection node_1;
3+
connection node_1;
14
cluster 1 node 1
25
SHOW STATUS LIKE 'wsrep_cluster_size';
36
Variable_name Value
47
wsrep_cluster_size 3
8+
connection node_2;
59
cluster 1 node 2
610
SHOW STATUS LIKE 'wsrep_cluster_size';
711
Variable_name Value
812
wsrep_cluster_size 3
13+
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
14+
connection node_3;
915
cluster 1 node 3
1016
SHOW STATUS LIKE 'wsrep_cluster_size';
1117
Variable_name Value
1218
wsrep_cluster_size 3
19+
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
20+
connection node_4;
1321
cluster 2 node 1
1422
SHOW STATUS LIKE 'wsrep_cluster_size';
1523
Variable_name Value
1624
wsrep_cluster_size 3
25+
connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5;
26+
connection node_5;
1727
cluster 2 node 2
1828
SHOW STATUS LIKE 'wsrep_cluster_size';
1929
Variable_name Value
2030
wsrep_cluster_size 3
31+
connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6;
32+
connection node_6;
2133
cluster 2 node 3
2234
SHOW STATUS LIKE 'wsrep_cluster_size';
2335
Variable_name Value
2436
wsrep_cluster_size 3
37+
connection node_1;
2538
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
2639
start slave;
2740
include/wait_for_slave_to_start.inc
@@ -31,6 +44,7 @@ select @@gtid_binlog_state;
3144
select @@gtid_slave_pos;
3245
@@gtid_slave_pos
3346

47+
connection node_4;
3448
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
3549
start slave;
3650
include/wait_for_slave_to_start.inc
@@ -41,15 +55,19 @@ select @@gtid_slave_pos;
4155
@@gtid_slave_pos
4256

4357
cluster 1 node 1
58+
connection node_1;
4459
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
4560
insert into t1 values (1, 11, 2);
4661
select @@gtid_binlog_state;
4762
@@gtid_binlog_state
4863
1-11-2
4964
#wait for sync cluster 1 and 2
65+
connection node_1;
5066
include/save_master_gtid.inc
67+
connection node_4;
5168
include/sync_with_master_gtid.inc
5269
cluster 2 node 1
70+
connection node_4;
5371
select @@gtid_binlog_state;
5472
@@gtid_binlog_state
5573
1-11-2
@@ -62,9 +80,12 @@ cluster_domain_id node_server_id seq_no
6280
1 11 2
6381
2 21 1
6482
#wait for sync cluster 1 and 2
83+
connection node_1;
6584
include/save_master_gtid.inc
85+
connection node_4;
6686
include/sync_with_master_gtid.inc
6787
cluster 1 node 2
88+
connection node_2;
6889
select @@gtid_binlog_state;
6990
@@gtid_binlog_state
7091
1-11-2,2-21-1
@@ -73,9 +94,12 @@ select @@gtid_binlog_state;
7394
@@gtid_binlog_state
7495
1-11-2,1-12-3,2-21-1
7596
#wait for sync cluster 1 and 2
97+
connection node_1;
7698
include/save_master_gtid.inc
99+
connection node_4;
77100
include/sync_with_master_gtid.inc
78101
cluster 1 node 3
102+
connection node_3;
79103
select @@gtid_binlog_state;
80104
@@gtid_binlog_state
81105
1-11-2,1-12-3,2-21-1
@@ -84,9 +108,12 @@ select @@gtid_binlog_state;
84108
@@gtid_binlog_state
85109
1-12-3,1-11-2,1-13-4,2-21-1
86110
#wait for sync cluster 1 and 2
111+
connection node_1;
87112
include/save_master_gtid.inc
113+
connection node_4;
88114
include/sync_with_master_gtid.inc
89115
cluster 2 node 2
116+
connection node_5;
90117
select @@gtid_binlog_state;
91118
@@gtid_binlog_state
92119
1-12-3,1-11-2,1-13-4,2-21-1
@@ -95,9 +122,12 @@ select @@gtid_binlog_state;
95122
@@gtid_binlog_state
96123
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
97124
#wait for sync cluster 2 and 1
125+
connection node_4;
98126
include/save_master_gtid.inc
127+
connection node_1;
99128
include/sync_with_master_gtid.inc
100129
cluster 2 node 3
130+
connection node_6;
101131
select @@gtid_binlog_state;
102132
@@gtid_binlog_state
103133
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
@@ -106,28 +136,53 @@ select @@gtid_binlog_state;
106136
@@gtid_binlog_state
107137
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
108138
#wait for sync cluster 2 and 1
139+
connection node_4;
109140
include/save_master_gtid.inc
141+
connection node_1;
110142
include/sync_with_master_gtid.inc
111143
cluster 1 node 1
144+
connection node_1;
112145
select @@gtid_binlog_state;
113146
@@gtid_binlog_state
114147
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
115148
drop table t1;
116149
stop slave;
117150
reset slave;
151+
cluster 2 node 1
152+
connection node_4;
153+
stop slave;
154+
reset slave;
155+
cluster 1 node 1
156+
connection node_1;
118157
change master to master_use_gtid=no, ignore_server_ids=();
158+
set global wsrep_on=OFF;
119159
reset master;
160+
set global wsrep_on=ON;
120161
set global GTID_SLAVE_POS="";
121162
cluster 2 node 1
122-
stop slave;
123-
reset slave;
163+
connection node_4;
124164
change master to master_use_gtid=no, ignore_server_ids=();
165+
set global wsrep_on=OFF;
125166
reset master;
167+
set global wsrep_on=ON;
126168
set global GTID_SLAVE_POS="";
169+
connection node_2;
170+
set global wsrep_on=OFF;
127171
reset master;
172+
set global wsrep_on=ON;
173+
connection node_3;
174+
set global wsrep_on=OFF;
128175
reset master;
176+
set global wsrep_on=ON;
177+
connection node_5;
178+
set global wsrep_on=OFF;
129179
reset master;
180+
set global wsrep_on=ON;
181+
connection node_6;
182+
set global wsrep_on=OFF;
130183
reset master;
184+
set global wsrep_on=ON;
185+
connection node_1;
131186
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
132187
start slave;
133188
include/wait_for_slave_to_start.inc
@@ -137,6 +192,7 @@ select @@gtid_binlog_state;
137192
select @@gtid_slave_pos;
138193
@@gtid_slave_pos
139194

195+
connection node_4;
140196
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
141197
start slave;
142198
include/wait_for_slave_to_start.inc
@@ -147,15 +203,19 @@ select @@gtid_slave_pos;
147203
@@gtid_slave_pos
148204

149205
cluster 1 node 1
206+
connection node_1;
150207
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
151208
insert into t1 values (1, 11, 2);
152209
select @@gtid_binlog_state;
153210
@@gtid_binlog_state
154211
1-11-2
155212
#wait for sync cluster 1 and 2
213+
connection node_1;
156214
include/save_master_gtid.inc
215+
connection node_4;
157216
include/sync_with_master_gtid.inc
158217
cluster 2 node 1
218+
connection node_4;
159219
insert into t1 values (2, 21, 1);
160220
select @@gtid_binlog_state;
161221
@@gtid_binlog_state
@@ -165,9 +225,12 @@ cluster_domain_id node_server_id seq_no
165225
1 11 2
166226
2 21 1
167227
#wait for sync cluster 1 and 2
228+
connection node_1;
168229
include/save_master_gtid.inc
230+
connection node_4;
169231
include/sync_with_master_gtid.inc
170232
cluster 1 node 2
233+
connection node_2;
171234
select @@gtid_binlog_state;
172235
@@gtid_binlog_state
173236
1-11-2,2-21-1
@@ -176,9 +239,12 @@ select @@gtid_binlog_state;
176239
@@gtid_binlog_state
177240
1-11-2,1-12-3,2-21-1
178241
#wait for sync cluster 1 and 2
242+
connection node_1;
179243
include/save_master_gtid.inc
244+
connection node_4;
180245
include/sync_with_master_gtid.inc
181246
cluster 1 node 3
247+
connection node_3;
182248
select @@gtid_binlog_state;
183249
@@gtid_binlog_state
184250
1-11-2,1-12-3,2-21-1
@@ -187,9 +253,12 @@ select @@gtid_binlog_state;
187253
@@gtid_binlog_state
188254
1-12-3,1-11-2,1-13-4,2-21-1
189255
#wait for sync cluster 1 and 2
256+
connection node_1;
190257
include/save_master_gtid.inc
258+
connection node_4;
191259
include/sync_with_master_gtid.inc
192260
cluster 2 node 2
261+
connection node_5;
193262
select @@gtid_binlog_state;
194263
@@gtid_binlog_state
195264
1-12-3,1-11-2,1-13-4,2-21-1
@@ -198,9 +267,12 @@ select @@gtid_binlog_state;
198267
@@gtid_binlog_state
199268
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
200269
#wait for sync cluster 2 and 1
270+
connection node_4;
201271
include/save_master_gtid.inc
272+
connection node_1;
202273
include/sync_with_master_gtid.inc
203274
cluster 2 node 3
275+
connection node_6;
204276
select @@gtid_binlog_state;
205277
@@gtid_binlog_state
206278
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
@@ -209,23 +281,43 @@ select @@gtid_binlog_state;
209281
@@gtid_binlog_state
210282
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
211283
#wait for sync cluster 2 and 1
284+
connection node_4;
212285
include/save_master_gtid.inc
286+
connection node_1;
213287
include/sync_with_master_gtid.inc
214288
cluster 1 node 1
289+
connection node_1;
215290
select @@gtid_binlog_state;
216291
@@gtid_binlog_state
217292
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
218293
drop table t1;
219294
stop slave;
220295
change master to master_use_gtid=no, ignore_server_ids=();
296+
set global wsrep_on=OFF;
221297
reset master;
298+
set global wsrep_on=ON;
222299
set global GTID_SLAVE_POS="";
223300
cluster 2 node 1
301+
connection node_4;
224302
stop slave;
225303
change master to master_use_gtid=no, ignore_server_ids=();
304+
set global wsrep_on=OFF;
226305
reset master;
306+
set global wsrep_on=ON;
227307
set global GTID_SLAVE_POS="";
308+
connection node_2;
309+
set global wsrep_on=OFF;
228310
reset master;
311+
set global wsrep_on=ON;
312+
connection node_3;
313+
set global wsrep_on=OFF;
229314
reset master;
315+
set global wsrep_on=ON;
316+
connection node_5;
317+
set global wsrep_on=OFF;
230318
reset master;
319+
set global wsrep_on=ON;
320+
connection node_6;
321+
set global wsrep_on=OFF;
231322
reset master;
323+
set global wsrep_on=ON;

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,45 @@ select @@gtid_binlog_state;
138138
drop table t1;
139139
stop slave;
140140
reset slave;
141+
142+
--echo cluster 2 node 1
143+
--connection node_4
144+
stop slave;
145+
reset slave;
146+
147+
--echo cluster 1 node 1
148+
--connection node_1
141149
change master to master_use_gtid=no, ignore_server_ids=();
150+
set global wsrep_on=OFF;
142151
reset master;
152+
set global wsrep_on=ON;
143153
set global GTID_SLAVE_POS="";
144154
--sleep 2
145155

146156
--echo cluster 2 node 1
147157
--connection node_4
148-
stop slave;
149-
reset slave;
150158
change master to master_use_gtid=no, ignore_server_ids=();
159+
set global wsrep_on=OFF;
151160
reset master;
161+
set global wsrep_on=ON;
152162
set global GTID_SLAVE_POS="";
153163

154164
--connection node_2
165+
set global wsrep_on=OFF;
155166
reset master;
167+
set global wsrep_on=ON;
156168
--connection node_3
169+
set global wsrep_on=OFF;
157170
reset master;
171+
set global wsrep_on=ON;
158172
--connection node_5
173+
set global wsrep_on=OFF;
159174
reset master;
175+
set global wsrep_on=ON;
160176
--connection node_6
177+
set global wsrep_on=OFF;
161178
reset master;
179+
set global wsrep_on=ON;
162180
#--enable_parsing
163181
#
164182
# This test creates 2x 3 nodes galera cluster.
@@ -272,21 +290,33 @@ select @@gtid_binlog_state;
272290
drop table t1;
273291
stop slave;
274292
change master to master_use_gtid=no, ignore_server_ids=();
293+
set global wsrep_on=OFF;
275294
reset master;
295+
set global wsrep_on=ON;
276296
set global GTID_SLAVE_POS="";
277297

278298
--echo cluster 2 node 1
279299
--connection node_4
280300
stop slave;
281301
change master to master_use_gtid=no, ignore_server_ids=();
302+
set global wsrep_on=OFF;
282303
reset master;
304+
set global wsrep_on=ON;
283305
set global GTID_SLAVE_POS="";
284306

285307
--connection node_2
308+
set global wsrep_on=OFF;
286309
reset master;
310+
set global wsrep_on=ON;
287311
--connection node_3
312+
set global wsrep_on=OFF;
288313
reset master;
314+
set global wsrep_on=ON;
289315
--connection node_5
316+
set global wsrep_on=OFF;
290317
reset master;
318+
set global wsrep_on=ON;
291319
--connection node_6
320+
set global wsrep_on=OFF;
292321
reset master;
322+
set global wsrep_on=ON;

0 commit comments

Comments
 (0)