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
9call mtr.add_suppression("WSREP: Trying to desync a node that is already paused");
10
11#-------------------------------------------------------------------------------
12#
13# Try to set wsrep_desync to ON/OFF while the RSU is in progress.
14#
15
16--connection node_1
17CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
18
19SET GLOBAL wsrep_desync=1;
20SET wsrep_OSU_method=RSU;
21
22SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
23--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
24
25--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
26--connection node_1a
27
28--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
29--source include/wait_condition.inc
30
31# Can't set to off while the node is already paused by the RSU action above.
32#--error ER_WRONG_VALUE_FOR_VAR
33SET GLOBAL wsrep_desync=0;
34SET DEBUG_SYNC= 'now SIGNAL continue';
35
36--connection node_1
37--reap
38
39--connection node_1a
40# Now it is fine as RSU action has completed.
41SET GLOBAL wsrep_desync=0;
42SHOW VARIABLES LIKE 'wsrep_desync';
43
44--connection node_1
45SHOW CREATE TABLE t1;
46SHOW VARIABLES LIKE 'wsrep_desync';
47SET wsrep_OSU_method=TOI;
48
49DROP TABLE t1;
50
51#-------------------------------------------------------------------------------
52#
53# Try to set wsrep_desync to ON/OFF while the FTWRL is in progress.
54#
55
56--connection node_1
57CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
58
59SET GLOBAL wsrep_desync=1;
60FLUSH TABLE WITH READ LOCK;
61# Can't set to off while the node is already paused by the RSU action above.
62--error ER_WRONG_VALUE_FOR_VAR
63SET GLOBAL wsrep_desync=0;
64UNLOCK TABLES;
65# Now it is fine as RSU action has completed.
66SET GLOBAL wsrep_desync=0;
67SHOW VARIABLES LIKE 'wsrep_desync';
68
69--connection node_1
70SHOW CREATE TABLE t1;
71SHOW VARIABLES LIKE 'wsrep_desync';
72DROP TABLE t1;
73
74
75#-------------------------------------------------------------------------------
76#
77# Try to see how RSU and FTWRL interfere with each other.
78# note: both are executing same action (desync + pause) so one of the workload
79# shouldn't execute action instead just reference count.
80#
81--connection node_1
82--echo #node-1
83CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
84
85SET GLOBAL wsrep_desync=1;
86SET wsrep_OSU_method=RSU;
87
88SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
89--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
90
91--connection node_1a
92--echo #node-1a
93
94--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
95--source include/wait_condition.inc
96
97# this will try to re-pause the provider but given the reference-counting
98# will just increment the counter and return with success.
99FLUSH TABLE WITH READ LOCK;
100
101--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
102--connection node_1b
103--echo #node-1b
104
105--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
106--source include/wait_condition.inc
107SET DEBUG_SYNC= 'now SIGNAL continue';
108
109--connection node_1
110--echo #node-1
111--reap
112SHOW CREATE TABLE t1;
113
114--connection node_1a
115--echo #node-1a
116# This unlock table will be resume the provider.
117UNLOCK TABLES;
118
119--connection node_1
120--echo #node-1
121SET GLOBAL wsrep_desync=0;
122SHOW CREATE TABLE t1;
123SHOW VARIABLES LIKE 'wsrep_desync';
124SET wsrep_OSU_method=TOI;
125
126DROP TABLE t1;
127
128