diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc index 0ad18ffefa2..760e032eeb1 100644 --- a/mysql-test/include/wait_for_slave_io_to_stop.inc +++ b/mysql-test/include/wait_for_slave_io_to_stop.inc @@ -28,6 +28,9 @@ # there is an error in the IO thread. # (If an error is _always_ expected, a better alternative might be to # use wait_for_slave_io_error.inc instead of this file). +# Note: This is currently always enabled, since a simple STOP SLAVE +# IO_THREAD can cause an error if it interrupts the slave's initial +# communication with the master (MDEV-32892). # # $rpl_debug # See include/rpl_init.inc @@ -39,12 +42,15 @@ --let $slave_param= Slave_IO_Running --let $slave_param_value= No -if (!$rpl_allow_error) -{ - --let $slave_error_param= Last_IO_Errno -} +--let $_io_stop_save_allow_error= $slave_error_param +# Disabled, as IO errors are left behind when a normal STOP SLAVE interrupts +# the initial communication between the IO thread and the master (MDEV-32892). +#if (!$rpl_allow_error) +#{ +# --let $slave_error_param= Last_IO_Errno +#} --source include/wait_for_slave_param.inc ---let $slave_error_param= +--let $slave_error_param= $_io_stop_save_allow_error --let $include_filename= wait_for_slave_io_to_stop.inc diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result index 33c1f1413b4..25212024623 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result @@ -63,7 +63,7 @@ include/wait_for_slave_io_error.inc [errno=1236] SHOW TABLES; Tables_in_test table1_no_encryption -include/stop_slave.inc +include/stop_slave_sql.inc reset slave; ########## # Cleanup diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test index c9dbc5c0e96..b74632690ca 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test @@ -137,8 +137,7 @@ SHOW TABLES; --disable_connect_log # IO thread is stopped, stop SQL thread only ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc --enable_connect_log reset slave; diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result index 16ea30557e7..c6835ff90f4 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result @@ -62,7 +62,7 @@ include/wait_for_slave_io_error.inc [errno=1236] # ..success SHOW TABLES; Tables_in_test -include/stop_slave.inc +include/stop_slave_sql.inc reset slave; ########## # Cleanup diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test index b96d11c998a..9991fb9b1b9 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test @@ -133,8 +133,7 @@ SHOW TABLES; --disable_connect_log # IO thread is stopped, wait for SQL thread to be stopped ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc --enable_connect_log reset slave; diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result index 944ad9331ad..7ce98cbcc10 100644 --- a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result @@ -192,7 +192,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; -include/stop_slave.inc +include/stop_slave_io.inc include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result index f1e8c78d1d1..39ea2f202ea 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result +++ b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result @@ -36,7 +36,7 @@ connection con_temp2; COMMIT; connection server_2; include/wait_for_slave_sql_error.inc [errno=1062] -include/stop_slave.inc +include/stop_slave_io.inc include/assert.inc [table t1 should have zero rows where a>32] SELECT * FROM t1 WHERE a>32; a diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.result b/mysql-test/suite/multi_source/gtid_slave_pos.result index 6daed494c55..44eb482327d 100644 --- a/mysql-test/suite/multi_source/gtid_slave_pos.result +++ b/mysql-test/suite/multi_source/gtid_slave_pos.result @@ -99,7 +99,7 @@ include/wait_for_slave_to_stop.inc set default_master_connection = 'slave2'; include/wait_for_slave_sql_error.inc [errno=1942] STOP SLAVE; -include/stop_slave.inc +include/wait_for_slave_io_to_stop.inc set default_master_connection = 'slave1'; START SLAVE; include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.test b/mysql-test/suite/multi_source/gtid_slave_pos.test index 8c8decc476e..cc418d76870 100644 --- a/mysql-test/suite/multi_source/gtid_slave_pos.test +++ b/mysql-test/suite/multi_source/gtid_slave_pos.test @@ -121,8 +121,7 @@ set default_master_connection = 'slave2'; --let $slave_sql_errno= 1942 --source include/wait_for_slave_sql_error.inc STOP SLAVE; ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/wait_for_slave_io_to_stop.inc set default_master_connection = 'slave1'; START SLAVE; --source include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/rpl/include/mdev-31448_conservative.inc b/mysql-test/suite/rpl/include/mdev-31448_conservative.inc index 53c0444886e..9ab585b0980 100644 --- a/mysql-test/suite/rpl/include/mdev-31448_conservative.inc +++ b/mysql-test/suite/rpl/include/mdev-31448_conservative.inc @@ -36,7 +36,8 @@ insert into t1 values (3); --connection slave --source include/start_slave.inc ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker'; +# Wildcard for `state` as it depends on whether WSREP is compiled in or not. +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker'; --source include/wait_condition.inc --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit%' and command LIKE 'Slave_worker'; --source include/wait_condition.inc diff --git a/mysql-test/suite/rpl/include/mdev-31448_optimistic.inc b/mysql-test/suite/rpl/include/mdev-31448_optimistic.inc index 23ddcbd5e6f..ab7de09480e 100644 --- a/mysql-test/suite/rpl/include/mdev-31448_optimistic.inc +++ b/mysql-test/suite/rpl/include/mdev-31448_optimistic.inc @@ -55,7 +55,8 @@ drop table t2; --source include/start_slave.inc --echo # wait for T1 ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker'; +# Wildcard for `state` as it depends on whether WSREP is compiled in or not. +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker'; --source include/wait_condition.inc --echo # wait for T2 diff --git a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test index 9d0a5685926..59bc4d056ab 100644 --- a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test +++ b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test @@ -433,8 +433,7 @@ source include/show_binlog_events.inc; --eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size # SQL slave is stopped, stop only IO thread ---let $rpl_only_running_threads= 1 -source include/stop_slave.inc; +source include/stop_slave_io.inc; source include/start_slave.inc; connection master; diff --git a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test index 793ec159082..72f481e00fb 100644 --- a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test @@ -207,8 +207,7 @@ START SLAVE; --let $status_items= Last_IO_Errno, Last_IO_Error --source include/show_slave_status.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc RESET SLAVE; --connection master diff --git a/mysql-test/suite/rpl/r/mdev-31448_kill_ooo_finish_optimistic.result b/mysql-test/suite/rpl/r/mdev-31448_kill_ooo_finish_optimistic.result index 2753e66fe48..a837fe8fa9c 100644 --- a/mysql-test/suite/rpl/r/mdev-31448_kill_ooo_finish_optimistic.result +++ b/mysql-test/suite/rpl/r/mdev-31448_kill_ooo_finish_optimistic.result @@ -42,7 +42,8 @@ include/save_master_gtid.inc connection slave; # # Cleanup -include/stop_slave.inc +include/wait_for_slave_sql_to_stop.inc +include/stop_slave_io.inc set @@global.slave_parallel_threads= 0; set @@global.slave_parallel_mode= conservative; set @@global.innodb_lock_wait_timeout= 50; diff --git a/mysql-test/suite/rpl/r/rpl_connection.result b/mysql-test/suite/rpl/r/rpl_connection.result index b5ce7f4ed71..9fb17b5f174 100644 --- a/mysql-test/suite/rpl/r/rpl_connection.result +++ b/mysql-test/suite/rpl/r/rpl_connection.result @@ -6,7 +6,7 @@ include/stop_slave.inc CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= ''; START SLAVE; include/wait_for_slave_io_error.inc [errno=1045, 1593] -include/stop_slave.inc +include/stop_slave_sql.inc CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= ''; START SLAVE; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result index feef82a57fc..5250c4bb36a 100644 --- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result +++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result @@ -135,7 +135,7 @@ i 2 3 SET @@global.debug_dbug=@saved_dbug; -include/stop_slave.inc +include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; @@ -204,7 +204,7 @@ i 10 11 SET @@global.debug_dbug=@saved_dbug; -include/stop_slave.inc +include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; @@ -287,7 +287,7 @@ i 16 17 SET @@global.debug_dbug=@saved_dbug; -include/stop_slave.inc +include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; @@ -384,7 +384,7 @@ i 22 23 SET @@global.debug_dbug=@saved_dbug; -include/stop_slave.inc +include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result index 593f83a7946..229ac02b1d1 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result @@ -23,7 +23,8 @@ INSERT INTO t1 VALUES (2); SET sql_log_bin=1; START SLAVE; include/wait_for_slave_sql_error.inc [errno=1062] -include/stop_slave.inc +include/wait_for_slave_io_to_start.inc +include/stop_slave_io.inc SET GLOBAL gtid_slave_pos= "0-1-100"; include/start_slave.inc SELECT * FROM t1 ORDER BY a; @@ -39,7 +40,7 @@ REPLACE INTO t1 VALUES (5); SET debug_dbug= @dbug_save; connection slave; include/wait_for_slave_sql_error.inc [errno=1590] -include/stop_slave.inc +include/stop_slave_io.inc SET sql_slave_skip_counter=1; include/start_slave.inc SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result index 3c363004170..2ee51245c90 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result @@ -36,7 +36,7 @@ CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_USE_GTID=CURRENT_POS; START SLAVE; include/wait_for_slave_io_error.inc [errno=1236] -include/stop_slave.inc +include/stop_slave_sql.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 1db69ea4b83..683b5fb569a 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -226,7 +226,7 @@ connection slave; call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 -include/stop_slave.inc +include/stop_slave_io.inc DROP TABLE t1; *** Master send to slave *** diff --git a/mysql-test/suite/rpl/r/rpl_mdev_17614.result b/mysql-test/suite/rpl/r/rpl_mdev_17614.result index 66aec55fe67..125f90c0485 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev_17614.result +++ b/mysql-test/suite/rpl/r/rpl_mdev_17614.result @@ -29,8 +29,7 @@ SELECT * FROM t1; a b c 1 1 1 2 2 3 -stop slave; -include/stop_slave.inc +include/stop_slave_io.inc reset slave; connection master; reset master; @@ -189,8 +188,7 @@ SELECT * FROM t1; a b c 1 1 1 2 2 3 -stop slave; -include/stop_slave.inc +include/stop_slave_io.inc reset slave; connection master; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 944ad9331ad..7ce98cbcc10 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -192,7 +192,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; -include/stop_slave.inc +include/stop_slave_io.inc include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result b/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result index f1e8c78d1d1..39ea2f202ea 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result @@ -36,7 +36,7 @@ connection con_temp2; COMMIT; connection server_2; include/wait_for_slave_sql_error.inc [errno=1062] -include/stop_slave.inc +include/stop_slave_io.inc include/assert.inc [table t1 should have zero rows where a>32] SELECT * FROM t1 WHERE a>32; a diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result index a8e569aad61..e10008352a9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result @@ -191,7 +191,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; -include/stop_slave.inc +include/stop_slave_io.inc include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_corruption.result b/mysql-test/suite/rpl/r/rpl_row_corruption.result index 24535460418..1950617af83 100644 --- a/mysql-test/suite/rpl/r/rpl_row_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result @@ -14,7 +14,7 @@ connection master; UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2; connection slave; include/wait_for_slave_sql_error.inc [errno=1593 ] -include/stop_slave.inc +include/stop_slave_io.inc SET @@global.debug_dbug=@saved_debug; include/start_slave.inc connection master; diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 944ad9331ad..7ce98cbcc10 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -192,7 +192,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; -include/stop_slave.inc +include/stop_slave_io.inc include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 992e6c2181b..391ef95104f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -109,7 +109,7 @@ START SLAVE; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' -include/stop_slave.inc +include/stop_slave_sql.inc RESET SLAVE; connection master; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result index 9dc0ee51e53..fe355f34cfa 100644 --- a/mysql-test/suite/rpl/r/semisync_future-7591.result +++ b/mysql-test/suite/rpl/r/semisync_future-7591.result @@ -13,7 +13,7 @@ connection master; insert into t1 values (1); reset master; connection slave; -include/stop_slave.inc +include/stop_slave_sql.inc reset slave; include/start_slave.inc set global rpl_semi_sync_slave_enabled = OFF; diff --git a/mysql-test/suite/rpl/t/mdev-31448_kill_ooo_finish_optimistic.test b/mysql-test/suite/rpl/t/mdev-31448_kill_ooo_finish_optimistic.test index ab2f846f33c..12f079dc99d 100644 --- a/mysql-test/suite/rpl/t/mdev-31448_kill_ooo_finish_optimistic.test +++ b/mysql-test/suite/rpl/t/mdev-31448_kill_ooo_finish_optimistic.test @@ -54,7 +54,8 @@ drop table t2; --source include/start_slave.inc --echo # wait for T1 ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker'; +# Wildcard for `state` as it depends on whether WSREP is compiled in or not. +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker'; --source include/wait_condition.inc --echo # wait for T2 @@ -81,8 +82,9 @@ DROP TABLE t1; --connection slave --echo # --echo # Cleanup ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--let $rpl_allow_error= 1 +--source include/wait_for_slave_sql_to_stop.inc +--source include/stop_slave_io.inc eval set @@global.slave_parallel_threads= $save_slave_parallel_threads; eval set @@global.slave_parallel_mode= $save_slave_parallel_mode; eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout; diff --git a/mysql-test/suite/rpl/t/rpl_connection.test b/mysql-test/suite/rpl/t/rpl_connection.test index 8eee639cd34..24ada7c85c6 100644 --- a/mysql-test/suite/rpl/t/rpl_connection.test +++ b/mysql-test/suite/rpl/t/rpl_connection.test @@ -16,8 +16,7 @@ CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= ''; START SLAVE; --let $slave_io_errno= 1045, 1593 --source include/wait_for_slave_io_error.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= ''; START SLAVE; diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test index 22331c39f1d..95fac6c2edb 100644 --- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test +++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test @@ -149,8 +149,7 @@ connection slave; SELECT * FROM t1; SET @@global.debug_dbug=@saved_dbug; ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); --echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before @@ -218,7 +217,7 @@ SELECT * FROM t1; SET @@global.debug_dbug=@saved_dbug; ---source include/stop_slave.inc +--source include/stop_slave_sql.inc let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); --echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before @@ -286,7 +285,7 @@ SELECT * FROM t1; SET @@global.debug_dbug=@saved_dbug; ---source include/stop_slave.inc +--source include/stop_slave_sql.inc let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); --echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before @@ -354,7 +353,7 @@ SELECT * FROM t1; SET @@global.debug_dbug=@saved_dbug; ---source include/stop_slave.inc +--source include/stop_slave_sql.inc let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); --echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test b/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test index c8c63cf5e6e..0ee54cd1183 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test @@ -31,8 +31,8 @@ SET sql_log_bin=1; START SLAVE; --let $slave_sql_errno=1062 --source include/wait_for_slave_sql_error.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/wait_for_slave_io_to_start.inc +--source include/stop_slave_io.inc # Skip the problem event from the master. SET GLOBAL gtid_slave_pos= "0-1-100"; --source include/start_slave.inc @@ -51,7 +51,7 @@ SET debug_dbug= @dbug_save; --connection slave --let $slave_sql_errno=1590 --source include/wait_for_slave_sql_error.inc ---source include/stop_slave.inc +--source include/stop_slave_io.inc SET sql_slave_skip_counter=1; --source include/start_slave.inc --sync_with_master diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test index 834efdc6a2d..6795c008311 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test @@ -50,8 +50,7 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, START SLAVE; --let $slave_io_errno= 1236 --source include/wait_for_slave_io_error.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index cae7a0e59ed..74e1deec44b 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -327,8 +327,7 @@ sleep 4; let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1); --echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_io.inc DROP TABLE t1; --echo diff --git a/mysql-test/suite/rpl/t/rpl_mdev_17614.test b/mysql-test/suite/rpl/t/rpl_mdev_17614.test index da70d3ef451..92fddc79e84 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev_17614.test +++ b/mysql-test/suite/rpl/t/rpl_mdev_17614.test @@ -40,9 +40,7 @@ SELECT * FROM t1; SELECT * FROM t1; # restart replication for the next testcase -stop slave; ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_io.inc reset slave; connection master; reset master; @@ -160,9 +158,7 @@ SELECT * FROM t1; SELECT * FROM t1; # restart replication for the next testcase -stop slave; ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_io.inc reset slave; connection master; reset master; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test index 6303c5c6ddd..e2b85f13cfa 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test @@ -95,8 +95,7 @@ COMMIT; --connection server_2 --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_io.inc --let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32 --let $assert_text= table t1 should have zero rows where a>32 --source include/assert.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption.test b/mysql-test/suite/rpl/t/rpl_row_corruption.test index 52828a639ed..6f4f9c882e2 100644 --- a/mysql-test/suite/rpl/t/rpl_row_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_row_corruption.test @@ -39,8 +39,7 @@ SET @@global.debug_dbug="d,inject_tblmap_same_id_maps_diff_table"; # wait for error 1593 (ER_SLAVE_FATAL_ERROR) --let $slave_sql_errno=1593 --source include/wait_for_slave_sql_error.inc ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_io.inc # clean up SET @@global.debug_dbug=@saved_debug; diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test index dd003486495..53d87182870 100644 --- a/mysql-test/suite/rpl/t/semisync_future-7591.test +++ b/mysql-test/suite/rpl/t/semisync_future-7591.test @@ -19,8 +19,7 @@ insert into t1 values (1); reset master; --connection slave ---let $rpl_only_running_threads= 1 ---source include/stop_slave.inc +--source include/stop_slave_sql.inc reset slave; --source include/start_slave.inc