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 12CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; 13 14SET GLOBAL wsrep_desync=1; 15SET wsrep_OSU_method=RSU; 16 17SET 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 28SET GLOBAL wsrep_desync=0; 29SET DEBUG_SYNC= 'now SIGNAL continue'; 30 31--connection node_1 32--reap 33 34SHOW CREATE TABLE t1; 35SHOW VARIABLES LIKE 'wsrep_desync'; 36SET wsrep_OSU_method=TOI; 37 38DROP TABLE t1; 39SET DEBUG_SYNC= 'RESET'; 40 41# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed 42 43--connection node_1 44CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; 45 46SET GLOBAL wsrep_desync=0; 47SET wsrep_OSU_method=RSU; 48 49SET 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 66SET DEBUG_SYNC= 'now SIGNAL continue'; 67 68--connection node_1 69--reap 70 71--connection node_1a 72--reap 73SET GLOBAL wsrep_desync=0; 74 75SHOW CREATE TABLE t1; 76 77# Restore old state 78SET wsrep_OSU_method=TOI; 79DROP TABLE t1; 80SET DEBUG_SYNC= 'RESET'; 81 82CALL mtr.add_suppression("Protocol violation"); 83CALL mtr.add_suppression("desync failed"); 84 85--connection node_2 86CALL mtr.add_suppression("Protocol violation"); 87