Debian Codegraph @

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

raw
1 #
2 # Test the case where a node that dropped prior to an inconsistency vote is
3 # able to rejoin via IST after the vote is complete
4 #
5
6 --source include/galera_cluster.inc
7 --source include/big_test.inc
8
9 --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
10 --connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
11
12 # Save original auto_increment_offset values.
13 --let $node_1=node_1
14 --let $node_2=node_2
15 --let $node_3=node_3
16 --let $node_4=node_4
17 --source include/auto_increment_offset_save.inc
18
19 --connection node_3
20 # Isolate node #3
21 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
22
23 # Wait for node #3 to leave cluster
24 --connection node_1
25 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
26 --source include/wait_condition.inc
27
28 # Introduce inconsistency on node #4
29 --connection node_4
30 SET SESSION wsrep_on=OFF;
31 CREATE TABLE t1 (f1 INTEGER);
32 SET SESSION wsrep_on=ON;
33 DROP TABLE t1;
34
35 # Wait for node #4 to be voted out
36 --connection node_1
37 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
38 --source include/wait_condition.inc
39 # Do some more stuff on the cluster to add to the IST stream
40 CREATE TABLE t2 (f1 INTEGER);
41
42 # Rejoin node #3
43 --connection node_3
44 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
45 --source include/galera_wait_ready.inc
46
47 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
48 --source include/wait_condition.inc
49
50 --connection node_1
51 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
52 --source include/wait_condition.inc
53
54 # Confirm that all is good
55 --connection node_3
56 SELECT COUNT(*) AS expect_0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
57 SELECT COUNT(*) AS expect_1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
58
59 # Rejoin node #4
60 --connection node_4
61 SET SESSION wsrep_on=OFF;
62 --source include/kill_galera.inc
63 --sleep 1
64 --echo Starting mysqld
65 --source include/start_mysqld.inc
66
67 --connection node_1
68 # Confirm node #4 has rejoined
69 --let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
70 --source include/wait_condition.inc
71
72 # Confirm that all is good and all nodes have identical data
73 SELECT COUNT(*) AS expect_0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
74 SELECT COUNT(*) AS expect_1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
75 CALL mtr.add_suppression("Slave SQL: Error 'Unknown table");
76
77 --connection node_2
78 SELECT COUNT(*) AS expect_0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
79 SELECT COUNT(*) AS expect_1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
80 CALL mtr.add_suppression("Slave SQL: Error 'Unknown table");
81
82 --connection node_3
83 SELECT COUNT(*) AS expect_0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
84 SELECT COUNT(*) AS expect_1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
85 CALL mtr.add_suppression("WSREP: Vote 0 \\(success\\) on .* is inconsistent with group\\. Leaving cluster\\.");
86
87 --connection node_4
88 SELECT COUNT(*) AS expect_0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
89 SELECT COUNT(*) AS expect_1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
90 CALL mtr.add_suppression("WSREP: Vote 0 \\(success\\) on .* is inconsistent with group\\. Leaving cluster\\.");
91
92 DROP TABLE t2;
93
94 --source suite/galera/include/auto_increment_offset_restore.inc
95
96 --disconnect node_3
97 --disconnect node_4