| 1 |
# |
| 2 |
# MDEV-32282 |
| 3 |
# |
| 4 |
# A node remains in paused state after two interleaving FTWRLs, |
| 5 |
# and the following CREATE TABLE fails with |
| 6 |
# |
| 7 |
# ER_UNKNOWN_COM_ERROR (1047): Aborting TOI: Replication paused on |
| 8 |
# node for FTWRL/BACKUP STAGE. |
| 9 |
# |
| 10 |
# node_1 node_1_a |
| 11 |
# ---------------------------------------------------------------------- |
| 12 |
# FTWRL |
| 13 |
# UNLOCK TABLES wait after resume_and_resync() |
| 14 |
# FTWRL wait after desync_and_pause() |
| 15 |
# continue |
| 16 |
# continue |
| 17 |
# UNLOCK TABLES |
| 18 |
# CREATE TABLE fails |
| 19 |
# |
| 20 |
--source include/galera_cluster.inc |
| 21 |
--source include/have_innodb.inc |
| 22 |
--source include/have_debug_sync.inc |
| 23 |
|
| 24 |
# Connection to control sync points |
| 25 |
--connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
| 26 |
SET SESSION wsrep_sync_wait=0; |
| 27 |
|
| 28 |
--echo # |
| 29 |
--echo # Case 1: FTWRL |
| 30 |
--echo # |
| 31 |
|
| 32 |
--connection node_1 |
| 33 |
SET SESSION wsrep_sync_wait=0; |
| 34 |
FLUSH TABLES WITH READ LOCK; |
| 35 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 36 |
SET SESSION debug_sync = "wsrep_unlock_global_read_lock_after_resume_and_resync SIGNAL unlock_ready WAIT_FOR unlock_continue"; |
| 37 |
--send UNLOCK TABLES |
| 38 |
|
| 39 |
--connection node_1_ctrl |
| 40 |
SET debug_sync = "now WAIT_FOR unlock_ready"; |
| 41 |
|
| 42 |
--connect node_1_a, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
| 43 |
--connection node_1_a |
| 44 |
SET SESSION debug_sync = "wsrep_global_read_lock_block_commit_after_pause SIGNAL lock_ready WAIT_FOR lock_continue"; |
| 45 |
--send FLUSH TABLES WITH READ LOCK |
| 46 |
|
| 47 |
--connection node_1_ctrl |
| 48 |
SET debug_sync = "now WAIT_FOR lock_ready"; |
| 49 |
SET debug_sync = "now SIGNAL unlock_continue"; |
| 50 |
|
| 51 |
--connection node_1 |
| 52 |
--reap |
| 53 |
|
| 54 |
--connection node_1_ctrl |
| 55 |
SET debug_sync = "now SIGNAL lock_continue"; |
| 56 |
|
| 57 |
--connection node_1_a |
| 58 |
--reap |
| 59 |
|
| 60 |
UNLOCK TABLES; |
| 61 |
--let $wait_condition = SELECT VARIABLE_VALUE = "Synced" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_local_state_comment" |
| 62 |
--source include/wait_condition.inc |
| 63 |
|
| 64 |
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 65 |
DROP TABLE t1; |
| 66 |
--connection node_1_ctrl |
| 67 |
SET debug_sync = "RESET"; |
| 68 |
|
| 69 |
--echo # |
| 70 |
--echo # Case 2: BACKUP STAGE |
| 71 |
--echo # |
| 72 |
# Although BACKUP STAGE was not involved in MDEV-32282, add a testcase |
| 73 |
# as it uses similar mechanism to pause and desync the node. |
| 74 |
# |
| 75 |
|
| 76 |
--connection node_1 |
| 77 |
SET SESSION wsrep_sync_wait=0; |
| 78 |
BACKUP STAGE START; |
| 79 |
BACKUP STAGE BLOCK_DDL; |
| 80 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 81 |
SET SESSION debug_sync = "wsrep_backup_stage_after_resume_and_resync SIGNAL resume_and_resync_ready WAIT_FOR resume_and_resync_continue"; |
| 82 |
--send BACKUP STAGE END |
| 83 |
|
| 84 |
--connection node_1_ctrl |
| 85 |
SET debug_sync = "now WAIT_FOR resume_and_resync_ready"; |
| 86 |
|
| 87 |
--connection node_1_a |
| 88 |
BACKUP STAGE START; |
| 89 |
SET SESSION debug_sync = "wsrep_backup_stage_after_desync_and_pause SIGNAL desync_and_pause_ready WAIT_FOR desync_and_pause_continue"; |
| 90 |
--send BACKUP STAGE BLOCK_DDL |
| 91 |
|
| 92 |
--connection node_1_ctrl |
| 93 |
SET debug_sync = "now WAIT_FOR desync_and_pause_ready"; |
| 94 |
SET debug_sync = "now SIGNAL resume_and_resync_continue"; |
| 95 |
|
| 96 |
--connection node_1 |
| 97 |
--reap |
| 98 |
|
| 99 |
--connection node_1_ctrl |
| 100 |
SET debug_sync = "now SIGNAL desync_and_pause_continue"; |
| 101 |
|
| 102 |
--connection node_1_a |
| 103 |
--reap |
| 104 |
BACKUP STAGE END; |
| 105 |
--let $wait_condition = SELECT VARIABLE_VALUE = "Synced" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_local_state_comment" |
| 106 |
--source include/wait_condition.inc |
| 107 |
|
| 108 |
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 109 |
DROP TABLE t1; |
| 110 |
|
| 111 |
--connection node_1_ctrl |
| 112 |
SET debug_sync = "RESET"; |
| 113 |
|
| 114 |
--echo # |
| 115 |
--echo # Case 3: FTWRL first, BACKUP STAGE second |
| 116 |
--echo # |
| 117 |
|
| 118 |
--connection node_1 |
| 119 |
SET SESSION wsrep_sync_wait=0; |
| 120 |
SET SESSION wsrep_sync_wait=0; |
| 121 |
FLUSH TABLES WITH READ LOCK; |
| 122 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 123 |
SET SESSION debug_sync = "wsrep_unlock_global_read_lock_after_resume_and_resync SIGNAL unlock_ready WAIT_FOR unlock_continue"; |
| 124 |
--send UNLOCK TABLES |
| 125 |
|
| 126 |
--connection node_1_ctrl |
| 127 |
SET debug_sync = "now WAIT_FOR unlock_ready"; |
| 128 |
|
| 129 |
--connection node_1_a |
| 130 |
BACKUP STAGE START; |
| 131 |
SET SESSION debug_sync = "wsrep_backup_stage_after_desync_and_pause SIGNAL desync_and_pause_ready WAIT_FOR desync_and_pause_continue"; |
| 132 |
--send BACKUP STAGE BLOCK_DDL |
| 133 |
|
| 134 |
--connection node_1_ctrl |
| 135 |
SET debug_sync = "now WAIT_FOR desync_and_pause_ready"; |
| 136 |
SET debug_sync = "now SIGNAL unlock_continue"; |
| 137 |
|
| 138 |
--connection node_1 |
| 139 |
--reap |
| 140 |
|
| 141 |
--connection node_1_ctrl |
| 142 |
SET debug_sync = "now SIGNAL desync_and_pause_continue"; |
| 143 |
|
| 144 |
--connection node_1_a |
| 145 |
--reap |
| 146 |
BACKUP STAGE END; |
| 147 |
--let $wait_condition = SELECT VARIABLE_VALUE = "Synced" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_local_state_comment" |
| 148 |
--source include/wait_condition.inc |
| 149 |
|
| 150 |
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 151 |
DROP TABLE t1; |
| 152 |
|
| 153 |
--connection node_1_ctrl |
| 154 |
SET debug_sync = "RESET"; |
| 155 |
|
| 156 |
--echo # |
| 157 |
--echo # Case 4: BACKUP STAGE first, then FTWRL |
| 158 |
--echo # |
| 159 |
--connection node_1 |
| 160 |
SET SESSION wsrep_sync_wait=0; |
| 161 |
BACKUP STAGE START; |
| 162 |
BACKUP STAGE BLOCK_DDL; |
| 163 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 164 |
SET SESSION debug_sync = "wsrep_backup_stage_after_resume_and_resync SIGNAL resume_and_resync_ready WAIT_FOR resume_and_resync_continue"; |
| 165 |
--send BACKUP STAGE END |
| 166 |
|
| 167 |
--connection node_1_ctrl |
| 168 |
SET debug_sync = "now WAIT_FOR resume_and_resync_ready"; |
| 169 |
--connection node_1_a |
| 170 |
SET SESSION debug_sync = "wsrep_global_read_lock_block_commit_after_pause SIGNAL lock_ready WAIT_FOR lock_continue"; |
| 171 |
--send FLUSH TABLES WITH READ LOCK |
| 172 |
|
| 173 |
--connection node_1_ctrl |
| 174 |
SET debug_sync = "now WAIT_FOR lock_ready"; |
| 175 |
SET debug_sync = "now SIGNAL resume_and_resync_continue"; |
| 176 |
|
| 177 |
--connection node_1 |
| 178 |
--reap |
| 179 |
|
| 180 |
--connection node_1_ctrl |
| 181 |
SET debug_sync = "now SIGNAL lock_continue"; |
| 182 |
|
| 183 |
--connection node_1_a |
| 184 |
--reap |
| 185 |
|
| 186 |
UNLOCK TABLES; |
| 187 |
--let $wait_condition = SELECT VARIABLE_VALUE = "Synced" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_local_state_comment" |
| 188 |
--source include/wait_condition.inc |
| 189 |
|
| 190 |
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 191 |
DROP TABLE t1; |
| 192 |
--connection node_1_ctrl |
| 193 |
SET debug_sync = "RESET"; |