| 1 |
# |
| 2 |
# MDEV-39011: The node running async slave replication hangs in shutdown. |
| 3 |
# The problem was in a leaked THD_count on the error path when |
| 4 |
# wsrep_restart_slave is set. |
| 5 |
# |
| 6 |
|
| 7 |
--source include/galera_cluster.inc |
| 8 |
--source include/have_innodb.inc |
| 9 |
--source include/have_debug.inc |
| 10 |
--source include/have_debug_sync.inc |
| 11 |
|
| 12 |
--let $node_1=node_1 |
| 13 |
--let $node_2=node_2 |
| 14 |
--source include/auto_increment_offset_save.inc |
| 15 |
|
| 16 |
# node 3 is a native MariaDB server operating as async replication master |
| 17 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 18 |
--connection node_3 |
| 19 |
RESET MASTER; |
| 20 |
|
| 21 |
# nodes 1 and 2 form a Galera cluster, node 2 operates as a slave for the |
| 22 |
# native MariaDB master in node 3 |
| 23 |
--connection node_2 |
| 24 |
--disable_query_log |
| 25 |
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; |
| 26 |
--enable_query_log |
| 27 |
|
| 28 |
SET GLOBAL DEBUG_DBUG = "+d,delay_sql_thread_after_release_run_lock"; |
| 29 |
START SLAVE; |
| 30 |
# Wait for the async slave thread to get started |
| 31 |
SET DEBUG_SYNC = "now WAIT_FOR sql_thread_run_lock_released"; |
| 32 |
# Simulate a node dropped error for Wsrep to go to the restart point |
| 33 |
SET GLOBAL DEBUG_DBUG = "+d,wsrep_async_slave_node_dropped_error"; |
| 34 |
SET DEBUG_SYNC = "now SIGNAL sql_thread_continue"; |
| 35 |
# Now wait again as the execution should follow the error path and repeat |
| 36 |
SET DEBUG_SYNC = "now WAIT_FOR sql_thread_run_lock_released"; |
| 37 |
# Don't follow the error path anymore |
| 38 |
SET GLOBAL DEBUG_DBUG = "-d,wsrep_async_slave_node_dropped_error"; |
| 39 |
SET DEBUG_SYNC = "now SIGNAL sql_thread_continue"; |
| 40 |
|
| 41 |
# Cleanup before restart |
| 42 |
SET DEBUG_SYNC = "RESET"; |
| 43 |
SET GLOBAL DEBUG_DBUG = ""; |
| 44 |
STOP SLAVE; |
| 45 |
RESET SLAVE; |
| 46 |
|
| 47 |
# Now try to restart the node: it should not hang in a shutdown |
| 48 |
--source include/restart_mysqld.inc |
| 49 |
|
| 50 |
--connection node_3 |
| 51 |
RESET MASTER; |
| 52 |
--disconnect node_3 |
| 53 |
|
| 54 |
--source include/auto_increment_offset_restore.inc |