Skip to content

Commit

Permalink
fixes for the mtr test
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaakola committed Nov 9, 2023
1 parent 1cc881c commit 182c19e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ connection node_1;
CALL insert_row('node1', 50);
CREATE TABLE t3(i int primary key) engine=innodb;
connection node_3;
# Restart node_3
# Rejoin node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
connection node_1b;
# Wait until node_3 is back in cluster
# node3 has joined
connection node_1;
# GTID in node1
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
Expand Down Expand Up @@ -140,12 +141,13 @@ CALL insert_row('node1', 100);;
# Restart node_2
connection node_2;
# restart
ALTER TABLE t2 ADD COLUMN (k int);
CALL insert_row('node2', 100);;
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
set wsrep_sync_wait=0;
connection node_1c;
# wait until node_1 and node_2 are in cluster
connection node_2;
ALTER TABLE t2 ADD COLUMN (k int);
CALL insert_row('node2', 100);;
# Restart node_3
connection node_3;
# restart
Expand All @@ -154,6 +156,7 @@ connection node_1c;
after cluster restart
connection node_2;
connection node_1;
connection node_1;
node1 GTID
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/galera_3nodes/t/MDEV-29171.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

--source include/galera_cluster.inc
--source include/galera_sst_method.inc
--source include/force_restart.inc

#
# Initially wsrep gtid domain id is 100
#

--connection node_1
select @@wsrep_gtid_domain_id,@@wsrep_node_name;

Expand Down
21 changes: 13 additions & 8 deletions mysql-test/suite/galera_3nodes/t/galera_gtid_consistency.test
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ show variables like '%gtid_binlog_pos%';

--echo # Shutdown node_3
--connection node_3
#--source include/shutdown_mysqld.inc
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';

--echo # Wait until node_3 leaves cluster
Expand All @@ -153,19 +152,18 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';

#
# do some inserts and DDL to node 1
# while node 23 is absent
# while node 3 is absent
#
--connection node_1
CALL insert_row('node1', 50);

CREATE TABLE t3(i int primary key) engine=innodb;

#
# restart node 3, should join by IST
# remove isolation in node 3, should join by IST
#
--connection node_3
--echo # Restart node_3
#--source include/start_mysqld.inc
--echo # Rejoin node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';

--connection node_1b
Expand All @@ -178,6 +176,7 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
#
# check gtid positions in all nodes
#
--connection node_1
--echo # GTID in node1
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
Expand Down Expand Up @@ -223,13 +222,15 @@ show variables like '%gtid_binlog_pos%';
--source include/shutdown_mysqld.inc

#
# bootstap cluster in order node1 - node2 -node3
# bootstap cluster in order node1 - node2 - node3
# send some inserts and DDL after each node started
#
--sleep 5
--echo # Bootstrap from node_1
--connection node_1
--let $restart_parameters = --wsrep_new_cluster
--source include/start_mysqld.inc

show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';

Expand All @@ -241,8 +242,6 @@ ANALYZE TABLE t2;
--let $restart_parameters =
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
ALTER TABLE t2 ADD COLUMN (k int);
--send CALL insert_row('node2', 100);

#
# connection node_1b may not be functional anymore, after node was
Expand All @@ -255,6 +254,11 @@ set wsrep_sync_wait=0;
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc

--connection node_2
ALTER TABLE t2 ADD COLUMN (k int);
--send CALL insert_row('node2', 100);


--echo # Restart node_3
--connection node_3
--let $restart_parameters =
Expand All @@ -277,6 +281,7 @@ set wsrep_sync_wait=0;
#
# check gtid positions in all nodes
#
--connection node_1
--echo node1 GTID
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
Expand Down

0 comments on commit 182c19e

Please sign in to comment.