Debian Codegraph @

mysql-test/suite/galera/t/galera_vote_rejoin_dml.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 --source include/force_restart.inc
9
10 --let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
11 --source include/wait_condition.inc
12
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_1
20 SET GLOBAL wsrep_provider_options = 'pc.weight=2';
21
22 # Isolate node #3
23 --connection node_3
24 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
25
26 # Wait for node #3 to leave cluster
27 --connection node_1
28 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
29 --source include/wait_condition.inc
30
31 --connection node_1
32 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(10)) ENGINE=InnoDB;
33 INSERT INTO t1 VALUES (1, 'A');
34
35 # Introduce inconsistency on node #4
36 --connection node_4
37 SET SESSION wsrep_on=OFF;
38 INSERT INTO t1 VALUES (2, 'B');
39 SET SESSION wsrep_on=ON;
40 --source include/galera_wait_ready.inc
41 DELETE FROM t1 WHERE f1 = 2;
42
43 # Wait for node #4 to be voted out
44 --connection node_1
45 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
46 --source include/wait_condition.inc
47
48 # Rejoin node #3
49 --connection node_3
50 --source include/wsrep_wait_disconnect.inc
51 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
52 --source include/galera_wait_ready.inc
53
54 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
55 --source include/wait_condition.inc
56
57 --connection node_1
58 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
59 --source include/wait_condition.inc
60
61 # Confirm that all is good
62 --connection node_3
63 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'A';
64 SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'B';
65
66 # Rejoin node #4
67 --connection node_4
68 SET SESSION wsrep_on=OFF;
69 --source include/kill_galera.inc
70 --sleep 1
71 --echo Starting mysqld
72 --source include/start_mysqld.inc
73
74 # Confirm node #4 has rejoined
75 --connection node_1
76 --let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
77 --source include/wait_condition.inc
78
79 # Confirm that all is good and all nodes have identical data
80
81 --connection node_1
82 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'A';
83 SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'B';
84 CALL mtr.add_suppression("mariadbd: Can't find record in 't1'");
85 CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows");
86 CALL mtr.add_suppression("WSREP: Event 3 Delete_rows_v1 apply failed: 120, seqno ");
87 SET GLOBAL wsrep_provider_options = 'pc.weight=1';
88
89 --connection node_2
90 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'A';
91 SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'B';
92 CALL mtr.add_suppression("mariadbd: Can't find record in 't1'");
93 CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows");
94 CALL mtr.add_suppression("WSREP: Event 3 Delete_rows_v1 apply failed: 120, seqno ");
95
96 --connection node_3
97 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'A';
98 SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'B';
99
100 --connection node_4
101 --source include/galera_wait_ready.inc
102 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'A';
103 SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'B';
104 CALL mtr.add_suppression("inconsistent with group");
105
106 DROP TABLE t1;
107
108 --source include/auto_increment_offset_restore.inc