diff options
Diffstat (limited to 'mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test')
-rw-r--r-- | mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test new file mode 100644 index 00000000000..882f846fe67 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test @@ -0,0 +1,86 @@ +# +# Test manipulating wsrep_desync while an RSU operation is in progress +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +# First, test wsrep_desync 1 > 0 during DDL + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; + +SET GLOBAL wsrep_desync=1; +SET wsrep_OSU_method=RSU; + +SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; +--send ALTER TABLE t1 ADD COLUMN f2 INTEGER; + + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 + +--connection node_1a +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables' +--source include/wait_condition.inc + +SET GLOBAL wsrep_desync=0; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection node_1 +--reap + +SHOW CREATE TABLE t1; +SHOW VARIABLES LIKE 'wsrep_desync'; +SET wsrep_OSU_method=TOI; + +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; + +# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; + +SET GLOBAL wsrep_desync=0; +SET wsrep_OSU_method=RSU; + +SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue'; +--send ALTER TABLE t1 ADD COLUMN f2 INTEGER; + +--connection node_1a + +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_create_table_no_lock' +--source include/wait_condition.inc + +# wsrep_desync=1 will block +--send SET GLOBAL wsrep_desync=1; + + +--connection node_1b +--sleep 2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1' +--source include/wait_condition.inc + +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection node_1 +--reap + +--connection node_1a +--reap +SET GLOBAL wsrep_desync=0; + +SHOW CREATE TABLE t1; + +# Restore old state +SET wsrep_OSU_method=TOI; +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; + +CALL mtr.add_suppression("Protocol violation"); +CALL mtr.add_suppression("desync failed"); + +--connection node_2 +CALL mtr.add_suppression("Protocol violation"); |