| 1 |
################################################################################ |
| 2 |
# BUG# reset slave all is not thread-safe |
| 3 |
# |
| 4 |
# RESET SLAVE ALL could delete a channel, even source_pos_wait and |
| 5 |
# wait_until_sql_thread_after_gtid were still waiting for binlog to be applied. |
| 6 |
# It caused server crash when the functions tried to access the channel which |
| 7 |
# had been deleted. |
| 8 |
# |
| 9 |
# A channel reference counter is added. It should be increased if the channel |
| 10 |
# should not be deleted when the code is running. RESET SLAVE ALL will wait |
| 11 |
# for no reference and then delete the channel. |
| 12 |
################################################################################ |
| 13 |
--source include/not_group_replication_plugin.inc |
| 14 |
--source include/have_debug_sync.inc |
| 15 |
--source include/have_binlog_format_row.inc |
| 16 |
--source include/master-slave.inc |
| 17 |
|
| 18 |
--echo # |
| 19 |
--echo # Case 1: Verify source_pos_wait can block RESET SLAVE ALL |
| 20 |
--echo # |
| 21 |
|
| 22 |
--source include/rpl_connection_slave.inc |
| 23 |
|
| 24 |
# Just wait immediately after entering the function. RESET SLAVE ALL |
| 25 |
# should be blocked by it. |
| 26 |
SET debug_sync = "begin_source_pos_wait SIGNAL wait_func_begin WAIT_FOR wait_func_continue"; |
| 27 |
--send SELECT source_pos_wait("master-bin.000001", 10000); |
| 28 |
|
| 29 |
--source extra/rpl_tests/rpl_reset_slave_all_thread_safe.inc |
| 30 |
|
| 31 |
--echo # |
| 32 |
--echo # Case 2: Verify wait_for_gtid_set can block RESET SLAVE ALL |
| 33 |
--echo # |
| 34 |
--source include/rpl_connection_slave.inc |
| 35 |
--source include/start_slave.inc |
| 36 |
|
| 37 |
# Just wait immediately after entering the function. RESET SLAVE ALL |
| 38 |
# should be blocked by it. |
| 39 |
SET debug_sync = "begin_wait_for_gtid_set SIGNAL wait_func_begin WAIT_FOR wait_func_continue"; |
| 40 |
--send SELECT wait_until_sql_thread_after_gtids(CONCAT(@@GLOBAL.server_uuid, ":100")) |
| 41 |
|
| 42 |
--source extra/rpl_tests/rpl_reset_slave_all_thread_safe.inc |
| 43 |
|
| 44 |
# Cleanup |
| 45 |
--let $rpl_only_running_threads= 1 |
| 46 |
--source include/rpl_end.inc |