Skip to content

Commit 7274bed

Browse files
Daniele SciasciaJan Lindström
authored andcommitted
Fix MTR test galera.galera_gcache_recover_manytrx
The kills the two nodes that compose the cluster and then recovers them. The first node that is recovered is expected to recover its gcache, so that when the second node is recovered, it is expected that it rejoins the cluster via IST. However, it is possible that if the second node is killed while it is applying in TOI mode, its local state is marked unsafe. In which case, SST is the only option to rejoin the cluster. codership/mysql-wsrep#323
1 parent ba07581 commit 7274bed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
--source include/galera_cluster.inc
77
--source include/big_test.inc
8+
--source include/have_log_bin.inc
89

910
SET SESSION wsrep_sync_wait = 0;
1011
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
@@ -93,6 +94,8 @@ END|
9394

9495
DELIMITER ;|
9596

97+
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
98+
9699
--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
97100
--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
98101
--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
@@ -124,6 +127,13 @@ DELIMITER ;|
124127

125128
--connection node_2
126129
SET SESSION wsrep_sync_wait = 0;
130+
131+
# Make sure that node_2 is not killed while TOIs are applied.
132+
# Otherwhise we risk that grastate file is marked unsafe, and
133+
# as a consequence the node cannot rejoin with IST.
134+
--let $wait_condition = SELECT VARIABLE_VALUE > $wsrep_last_committed_before FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
135+
--source include/wait_condition.inc
136+
127137
--source include/kill_galera.inc
128138

129139
--sleep 10
@@ -172,9 +182,8 @@ SET SESSION wsrep_sync_wait = 0;
172182
--source include/start_mysqld.inc
173183

174184
--connection node_1
175-
--source include/wait_until_connected_again.inc
176-
--source include/galera_wait_ready.inc
177185
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
186+
--source include/wait_condition.inc
178187

179188
--let $diff_servers = 1 2
180189
--source include/diff_servers.inc

0 commit comments

Comments
 (0)