Skip to content

Commit 2438afb

Browse files
philip-galeraNirbhay Choubey
authored andcommitted
Galera MTR tests: MW-246 mariadb-corporation/mysql-wsrep#247 Additional tests around RSU and wsrep_desync
1 parent 13627d4 commit 2438afb

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
2+
SET GLOBAL wsrep_desync=1;
3+
SET wsrep_OSU_method=RSU;
4+
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
5+
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
6+
SET GLOBAL wsrep_desync=0;
7+
SET DEBUG_SYNC= 'now SIGNAL continue';
8+
SHOW CREATE TABLE t1;
9+
Table Create Table
10+
t1 CREATE TABLE `t1` (
11+
`f1` int(11) DEFAULT NULL,
12+
`f2` int(11) DEFAULT NULL
13+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
14+
SHOW VARIABLES LIKE 'wsrep_desync';
15+
Variable_name Value
16+
wsrep_desync OFF
17+
SET wsrep_OSU_method=TOI;
18+
DROP TABLE t1;
19+
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
20+
SET GLOBAL wsrep_desync=0;
21+
Warnings:
22+
Warning 1231 'wsrep_desync' is already OFF.
23+
SET wsrep_OSU_method=RSU;
24+
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
25+
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
26+
SET GLOBAL wsrep_desync=1;
27+
ERROR HY000: Operation 'desync' failed for SET GLOBAL wsrep_desync=1
28+
SET GLOBAL wsrep_desync=0;
29+
SET DEBUG_SYNC= 'now SIGNAL continue';
30+
SHOW CREATE TABLE t1;
31+
Table Create Table
32+
t1 CREATE TABLE `t1` (
33+
`f1` int(11) DEFAULT NULL,
34+
`f2` int(11) DEFAULT NULL
35+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
36+
SET wsrep_OSU_method=TOI;
37+
DROP TABLE t1;
38+
CALL mtr.add_suppression("Protocol violation");
39+
CALL mtr.add_suppression("desync failed");
40+
CALL mtr.add_suppression("Protocol violation");
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
21+
--connection node_1a
22+
23+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
24+
--source include/wait_condition.inc
25+
26+
SET GLOBAL wsrep_desync=0;
27+
SET DEBUG_SYNC= 'now SIGNAL continue';
28+
29+
--connection node_1
30+
--reap
31+
32+
SHOW CREATE TABLE t1;
33+
SHOW VARIABLES LIKE 'wsrep_desync';
34+
SET wsrep_OSU_method=TOI;
35+
36+
DROP TABLE t1;
37+
38+
# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
39+
40+
--connection node_1
41+
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
42+
43+
SET GLOBAL wsrep_desync=0;
44+
SET wsrep_OSU_method=RSU;
45+
46+
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
47+
--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
48+
49+
--connection node_1a
50+
51+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
52+
--source include/wait_condition.inc
53+
54+
# This transition is currently not allowed
55+
--error ER_CANNOT_USER
56+
SET GLOBAL wsrep_desync=1;
57+
SET GLOBAL wsrep_desync=0;
58+
59+
SET DEBUG_SYNC= 'now SIGNAL continue';
60+
61+
--connection node_1
62+
--reap
63+
64+
SHOW CREATE TABLE t1;
65+
SET wsrep_OSU_method=TOI;
66+
DROP TABLE t1;
67+
68+
CALL mtr.add_suppression("Protocol violation");
69+
CALL mtr.add_suppression("desync failed");
70+
71+
--connection node_2
72+
CALL mtr.add_suppression("Protocol violation");
73+
74+

0 commit comments

Comments
 (0)