|
| 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