Debian Codegraph @

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

raw
1 #
2 # Test manipulating wsrep_desync while an RSU operation is in progress
3 #
4
5 --source include/galera_cluster.inc
6 --source include/have_innodb.inc
7 --source include/have_debug_sync.inc
8
9 # First, test wsrep_desync 1 > 0 during DDL
10
11 --connection node_1
12 CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
13
14 SET GLOBAL wsrep_desync=1;
15 SET wsrep_OSU_method=RSU;
16
17 SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
18 --send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
19
20
21 --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
22 --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
23
24 --connection node_1a
25 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
26 --source include/wait_condition.inc
27
28 SET GLOBAL wsrep_desync=0;
29 SET DEBUG_SYNC= 'now SIGNAL continue';
30
31 --connection node_1
32 --reap
33
34 SHOW CREATE TABLE t1;
35 SHOW VARIABLES LIKE 'wsrep_desync';
36 SET wsrep_OSU_method=TOI;
37
38 DROP TABLE t1;
39 SET DEBUG_SYNC= 'RESET';
40
41 # Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
42
43 --connection node_1
44 CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
45
46 SET GLOBAL wsrep_desync=0;
47 SET wsrep_OSU_method=RSU;
48
49 SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue';
50 --send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
51
52 --connection node_1a
53
54 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_create_table_no_lock'
55 --source include/wait_condition.inc
56
57 # wsrep_desync=1 will block
58 --send SET GLOBAL wsrep_desync=1;
59
60
61 --connection node_1b
62 --sleep 2
63 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1'
64 --source include/wait_condition.inc
65
66 SET DEBUG_SYNC= 'now SIGNAL continue';
67
68 --connection node_1
69 --reap
70
71 --connection node_1a
72 --reap
73 SET GLOBAL wsrep_desync=0;
74
75 SHOW CREATE TABLE t1;
76
77 # Restore old state
78 SET wsrep_OSU_method=TOI;
79 DROP TABLE t1;
80 SET DEBUG_SYNC= 'RESET';
81
82 CALL mtr.add_suppression("Protocol violation");
83 CALL mtr.add_suppression("desync failed");
84
85 --connection node_2
86 CALL mtr.add_suppression("Protocol violation");