diff --git a/mysql-test/include/kill_binlog_dump_threads.inc b/mysql-test/include/kill_binlog_dump_threads.inc index 38e3e2a7c98..2e8378d4a9d 100644 --- a/mysql-test/include/kill_binlog_dump_threads.inc +++ b/mysql-test/include/kill_binlog_dump_threads.inc @@ -38,6 +38,7 @@ while ($wait_counter) let $_tid= `SELECT id FROM information_schema.processlist WHERE command = 'Binlog Dump' LIMIT 1`; if ($_tid) { + --error 0,ER_NO_SUCH_THREAD eval KILL QUERY $_tid; } if (!$_tid) @@ -55,6 +56,14 @@ if (!$success) SHOW FULL PROCESSLIST; --die Timeout while waiting for binlog dump threads to disappear. } +# This an attempt to get more info about a rare sporadic test failure where +# RESET MASTER still fails with ER_BINLOG_IN_USE after this has run. +--let $sanity_check= `SELECT COUNT(*) FROM information_schema.processlist WHERE command = 'Binlog Dump'` +if ($sanity_check > 0) { + SHOW FULL PROCESSLIST; + --echo ERROR: still $sanity_check dump thread(s) found! + --die ERROR: still $sanity_check dump thread(s) found +} --enable_query_log diff --git a/mysql-test/include/reset_master_slave.inc b/mysql-test/include/reset_master_slave.inc index af66da2bb8b..a468ee873be 100644 --- a/mysql-test/include/reset_master_slave.inc +++ b/mysql-test/include/reset_master_slave.inc @@ -21,6 +21,7 @@ while ($con_name != 'No such row') --let $con_name = query_get_value(show all slaves status, Connection_name, 1) } +--source include/kill_binlog_dump_threads.inc --error 0,ER_FLUSH_MASTER_BINLOG_CLOSED reset master; set global gtid_slave_pos=''; diff --git a/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc b/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc index 5961e3cc096..e73fcb054bd 100644 --- a/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc +++ b/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc @@ -293,6 +293,7 @@ if ($cnf == "galera2_to_mariadb") --connection master set global wsrep_on=OFF; + --source include/kill_binlog_dump_threads.inc RESET MASTER; set global wsrep_on=ON; } diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc index 26ce4e1b57f..671943340b3 100644 --- a/mysql-test/include/rpl_init.inc +++ b/mysql-test/include/rpl_init.inc @@ -162,6 +162,7 @@ while ($_rpl_server) USE test; if (!$rpl_skip_reset_master_and_slave) { + --source include/kill_binlog_dump_threads.inc if (!$rpl_server_skip_log_bin) { --error 0 diff --git a/mysql-test/include/rpl_ip_mix.inc b/mysql-test/include/rpl_ip_mix.inc index d547d77a3cc..01db8b4d77d 100644 --- a/mysql-test/include/rpl_ip_mix.inc +++ b/mysql-test/include/rpl_ip_mix.inc @@ -1,6 +1,7 @@ connect (master,$IPv6,root,,test,$MASTER_MYPORT); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT); connection master; +--source include/kill_binlog_dump_threads.inc reset master; source include/show_master_status.inc; save_master_pos; diff --git a/mysql-test/include/rpl_ipv6.inc b/mysql-test/include/rpl_ipv6.inc index 69f282e22d9..762e51a82e9 100644 --- a/mysql-test/include/rpl_ipv6.inc +++ b/mysql-test/include/rpl_ipv6.inc @@ -1,5 +1,6 @@ connect (master,$IPv6,root,,test,$MASTER_MYPORT); connect (slave,$IPv6,root,,test,$SLAVE_MYPORT); +--source include/kill_binlog_dump_threads.inc connection master; reset master; source include/show_master_status.inc; diff --git a/mysql-test/include/rpl_multi_engine2.inc b/mysql-test/include/rpl_multi_engine2.inc index 24154220cb0..e7cd7ef38d3 100644 --- a/mysql-test/include/rpl_multi_engine2.inc +++ b/mysql-test/include/rpl_multi_engine2.inc @@ -9,6 +9,7 @@ STOP SLAVE; RESET SLAVE; connection master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; diff --git a/mysql-test/include/rpl_reset.inc b/mysql-test/include/rpl_reset.inc index 53ed1de9874..458d9dcb573 100644 --- a/mysql-test/include/rpl_reset.inc +++ b/mysql-test/include/rpl_reset.inc @@ -63,11 +63,26 @@ while ($_rpl_server) --let $rpl_connection_name= server_$_rpl_server --source include/rpl_connection.inc - RESET MASTER; # Check if this server is configured to have a master if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`) { --source include/stop_slave.inc + } + --dec $_rpl_server +} + +--let $_rpl_server= $rpl_server_count +while ($_rpl_server) +{ + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + + --source include/kill_binlog_dump_threads.inc + RESET MASTER; + + # Check if this server is configured to have a master + if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`) + { --source include/reset_slave.inc } --dec $_rpl_server diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc index 1ce846eed0b..cbf69c2df80 100644 --- a/mysql-test/include/test_fieldsize.inc +++ b/mysql-test/include/test_fieldsize.inc @@ -17,6 +17,7 @@ eval $test_table_slave; connection master; eval $test_table_master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; eval $test_insert; @@ -33,6 +34,7 @@ STOP SLAVE; --source include/reset_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result index a00b1c0c1a3..b831bf25558 100644 --- a/mysql-test/suite/binlog/r/binlog_checkpoint.result +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -137,12 +137,9 @@ connect con3,localhost,root,,; SET debug_sync="reset_logs_after_set_reset_master_pending SIGNAL reset_master_ready WAIT_FOR reset_master_cont"; RESET MASTER; connection default; -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; SET debug_sync="now WAIT_FOR reset_master_ready"; RESET MASTER; -SET debug_sync="now WAIT_FOR injected_binlog_background_thread"; -SET GLOBAL debug_dbug=@old_dbug; +ERROR HY000: Cannot execute RESET MASTER as the binlog is in use by a connected slave or other RESET MASTER or binlog reader. Check SHOW PROCESSLIST for "Binlog Dump" commands and use KILL to stop such readers SET debug_sync="now SIGNAL reset_master_cont"; connection con3; connection default; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result index 88a3c6cc8ac..a82e1b53aca 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result @@ -3,6 +3,7 @@ SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-01 10:20:30.123456'); # Clear the existing binary log state, and start fresh using # the timestamp variable set above # +include/kill_binlog_dump_threads.inc RESET MASTER; create table t1 (a int); insert into t1 values (1); diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint.test b/mysql-test/suite/binlog/t/binlog_checkpoint.test index 4237f33c8af..96d2cb9b0f9 100644 --- a/mysql-test/suite/binlog/t/binlog_checkpoint.test +++ b/mysql-test/suite/binlog/t/binlog_checkpoint.test @@ -160,12 +160,9 @@ SET debug_sync="reset_logs_after_set_reset_master_pending SIGNAL reset_master_re send RESET MASTER; --connection default -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; SET debug_sync="now WAIT_FOR reset_master_ready"; +--error ER_BINLOG_IN_USE RESET MASTER; -SET debug_sync="now WAIT_FOR injected_binlog_background_thread"; -SET GLOBAL debug_dbug=@old_dbug; SET debug_sync="now SIGNAL reset_master_cont"; --connection con3 diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test index f862f0e7887..9ccb367f9ec 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test @@ -29,6 +29,7 @@ --echo # Clear the existing binary log state, and start fresh using --echo # the timestamp variable set above --echo # +--source include/kill_binlog_dump_threads.inc RESET MASTER; --let $binlog_f1= query_get_value(SHOW MASTER STATUS, File, 1) diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result index 442b2a5da1d..dddf26aa0b9 100644 --- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result +++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result @@ -13,6 +13,7 @@ call mtr.add_suppression("Could not use master-bin for logging"); SET @old_debug= @@global.debug_dbug; SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data'; SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data'; +include/kill_binlog_dump_threads.inc RESET MASTER; ###################### TEST #1 FLUSH LOGS; @@ -273,5 +274,6 @@ Note 1255 Slave already has been stopped RESET SLAVE; Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' +include/kill_binlog_dump_threads.inc RESET MASTER; include/rpl_end.inc diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.result b/mysql-test/suite/binlog_encryption/rpl_checksum.result index 503f359f726..0fbb751dff7 100644 --- a/mysql-test/suite/binlog_encryption/rpl_checksum.result +++ b/mysql-test/suite/binlog_encryption/rpl_checksum.result @@ -134,6 +134,7 @@ set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); flush logs; connection master; set @@global.binlog_checksum= CRC32; +include/kill_binlog_dump_threads.inc reset master; flush logs; create table t3 (a int, b char(5)); @@ -148,6 +149,7 @@ include/stop_slave.inc change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; connection master; flush logs; +include/kill_binlog_dump_threads.inc reset master; insert into t3 value (1, @@global.binlog_checksum); connection slave; diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result index 99721813159..4c79bce26b7 100644 --- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result +++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result @@ -197,6 +197,7 @@ connection server_1; SET @old_state= @@GLOBAL.gtid_binlog_state; SET GLOBAL gtid_binlog_state = ''; ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL gtid_binlog_state = ''; FLUSH LOGS; diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.result b/mysql-test/suite/binlog_encryption/rpl_packet.result index bb6269607fe..3f62e585ad5 100644 --- a/mysql-test/suite/binlog_encryption/rpl_packet.result +++ b/mysql-test/suite/binlog_encryption/rpl_packet.result @@ -65,6 +65,7 @@ Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @max_allowed_packet_0= @@session.max_allowed_packet; SHOW BINLOG EVENTS; diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result index 03e3443b31e..44dbec183eb 100644 --- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result +++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result @@ -20,6 +20,7 @@ include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; +include/kill_binlog_dump_threads.inc reset master; set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -301,8 +302,10 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; +include/stop_slave.inc [ test reset master ] connection master; +include/kill_binlog_dump_threads.inc reset master; show status like 'Rpl_semi_sync_master_status'; Variable_name Value @@ -314,7 +317,6 @@ show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; -include/stop_slave.inc include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; @@ -349,6 +351,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; include/kill_binlog_dump_threads.inc set sql_log_bin=0; diff --git a/mysql-test/suite/engines/funcs/r/rpl_000015.result b/mysql-test/suite/engines/funcs/r/rpl_000015.result index 56fc002ac53..c948289fba5 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_000015.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000015.result @@ -1,11 +1,14 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +connection master; +include/kill_binlog_dump_threads.inc reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 329 connection slave; -include/stop_slave.inc reset slave; Slave_IO_Running = 'No' Slave_SQL_Running = 'No' diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result index 3d8eeb02ca6..033643177fc 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result @@ -20,6 +20,7 @@ stop slave; include/wait_for_slave_to_stop.inc drop table t1; connection master; +include/kill_binlog_dump_threads.inc reset master; create table t1(n int); create table t2(n int); diff --git a/mysql-test/suite/engines/funcs/r/rpl_trigger.result b/mysql-test/suite/engines/funcs/r/rpl_trigger.result index 3913508d032..8f2c1f6a7b8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_trigger.result +++ b/mysql-test/suite/engines/funcs/r/rpl_trigger.result @@ -1006,6 +1006,7 @@ SHOW TABLES LIKE 't_'; Tables_in_test (t_) SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; include/start_slave.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_000015.test b/mysql-test/suite/engines/funcs/t/rpl_000015.test index 8996affe667..fa078773295 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_000015.test +++ b/mysql-test/suite/engines/funcs/t/rpl_000015.test @@ -5,11 +5,14 @@ ##################### --source include/master-slave.inc +connection slave; +--source include/stop_slave.inc +connection master; +--source include/kill_binlog_dump_threads.inc reset master; show master status; save_master_pos; connection slave; ---source include/stop_slave.inc reset slave; --let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_SQL_Errno, Last_SQL_Error, Exec_Master_Log_Pos --source include/show_slave_status.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_trigger.test b/mysql-test/suite/engines/funcs/t/rpl_trigger.test index 12eef32ef83..8f58a577818 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_trigger.test +++ b/mysql-test/suite/engines/funcs/t/rpl_trigger.test @@ -357,6 +357,7 @@ connection master; SHOW TABLES LIKE 't_'; SHOW TRIGGERS; +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Restart slave. diff --git a/mysql-test/suite/galera/r/MDEV-28053.result b/mysql-test/suite/galera/r/MDEV-28053.result index b3f93688dd0..5aa2ab5cb7a 100644 --- a/mysql-test/suite/galera/r/MDEV-28053.result +++ b/mysql-test/suite/galera/r/MDEV-28053.result @@ -11,4 +11,5 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_2primary_replica.result b/mysql-test/suite/galera/r/galera_2primary_replica.result index 9901caa9eb6..cd10fc97832 100644 --- a/mysql-test/suite/galera/r/galera_2primary_replica.result +++ b/mysql-test/suite/galera/r/galera_2primary_replica.result @@ -86,8 +86,10 @@ Note 1938 SLAVE 'stream1' stopped Note 1938 SLAVE 'stream2' stopped RESET SLAVE ALL; connection primary1; +include/kill_binlog_dump_threads.inc RESET MASTER; connection primary2; +include/kill_binlog_dump_threads.inc RESET MASTER; connection node_1; disconnect primary1; diff --git a/mysql-test/suite/galera/r/galera_as_master.result b/mysql-test/suite/galera/r/galera_as_master.result index dd3e017379c..6764199818b 100644 --- a/mysql-test/suite/galera/r/galera_as_master.result +++ b/mysql-test/suite/galera/r/galera_as_master.result @@ -59,5 +59,6 @@ RESET SLAVE ALL; CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work'); connection node_1; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_as_slave.result b/mysql-test/suite/galera/r/galera_as_slave.result index 1035fe1e9be..ecd7a2c063d 100644 --- a/mysql-test/suite/galera/r/galera_as_slave.result +++ b/mysql-test/suite/galera/r/galera_as_slave.result @@ -29,4 +29,5 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_as_slave_autoinc.result b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result index ffaa62c0003..5e3bd335731 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_autoinc.result +++ b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result @@ -97,4 +97,5 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_as_slave_ctas.result b/mysql-test/suite/galera/r/galera_as_slave_ctas.result index a3d28ce42aa..d3c9543fd36 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_ctas.result +++ b/mysql-test/suite/galera/r/galera_as_slave_ctas.result @@ -28,4 +28,5 @@ connection node_1; STOP SLAVE; RESET SLAVE ALL; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-test/suite/galera/r/galera_as_slave_gtid.result index 41d9085ccac..665b58bd5d4 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid.result @@ -28,11 +28,14 @@ RESET SLAVE ALL; #cleanup connection node_1; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_2; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_3; +include/kill_binlog_dump_threads.inc reset master; diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid_auto_engine.result b/mysql-test/suite/galera/r/galera_as_slave_gtid_auto_engine.result index cff5bb0a5d0..91c86901e87 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid_auto_engine.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid_auto_engine.result @@ -28,13 +28,16 @@ RESET SLAVE ALL; #cleanup connection node_1; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_2; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_3; +include/kill_binlog_dump_threads.inc reset master; connection node_2; DROP TABLE mysql.gtid_slave_pos_InnoDB; diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result index 5698ebf9fd3..ddfebf7db99 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result @@ -28,16 +28,18 @@ DROP TABLE t1; connection node_1; connection node_2; connection node_3; -RESET MASTER; connection node_1; STOP SLAVE; RESET SLAVE ALL; SET GLOBAL WSREP_ON=OFF; +include/kill_binlog_dump_threads.inc reset master; SET GLOBAL WSREP_ON=ON; connection node_2; SET GLOBAL WSREP_ON=OFF; +include/kill_binlog_dump_threads.inc reset master; SET GLOBAL WSREP_ON=ON; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_as_slave_nonprim.result b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result index 969e844577e..11444e6aa96 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_nonprim.result +++ b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result @@ -31,4 +31,5 @@ CALL mtr.add_suppression("(Transport endpoint|Socket) is not connected"); CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213"); CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047"); connection node_4; +include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_circular_replication.result b/mysql-test/suite/galera/r/galera_circular_replication.result index 0094283d40b..e9f59f77385 100644 --- a/mysql-test/suite/galera/r/galera_circular_replication.result +++ b/mysql-test/suite/galera/r/galera_circular_replication.result @@ -128,6 +128,7 @@ RESET SLAVE ALL; connection replica2; STOP SLAVE; RESET SLAVE ALL; +include/kill_binlog_dump_threads.inc RESET MASTER; connection node_1; disconnect primary1; diff --git a/mysql-test/suite/galera/r/galera_gtid_slave.result b/mysql-test/suite/galera/r/galera_gtid_slave.result index 180be320102..f9a093eab34 100644 --- a/mysql-test/suite/galera/r/galera_gtid_slave.result +++ b/mysql-test/suite/galera/r/galera_gtid_slave.result @@ -33,13 +33,16 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; SET GLOBAL wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; SET GLOBAL wsrep_on=ON; connection node_1; SET GLOBAL wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; SET GLOBAL wsrep_on=ON; connection node_3; +include/kill_binlog_dump_threads.inc reset master; connection node_2; CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result index e9f11d6f44b..a7e69a5cff3 100644 --- a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result +++ b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result @@ -155,16 +155,19 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global gtid_slave_pos=""; #Connection 1 connection node_1; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; #Connection 3 connection node_3; +include/kill_binlog_dump_threads.inc reset master; connection node_2; CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result index d07fe62c2d5..755f2218923 100644 --- a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result +++ b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result @@ -113,6 +113,7 @@ Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' connection node_1; SET SESSION WSREP_ON=OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET SESSION WSREP_ON=ON; disconnect node_2; diff --git a/mysql-test/suite/galera/r/galera_replica_no_gtid.result b/mysql-test/suite/galera/r/galera_replica_no_gtid.result index f4b1a344400..5643ba614c3 100644 --- a/mysql-test/suite/galera/r/galera_replica_no_gtid.result +++ b/mysql-test/suite/galera/r/galera_replica_no_gtid.result @@ -59,6 +59,7 @@ connection node_2; STOP SLAVE; RESET SLAVE ALL; connection node_3; +include/kill_binlog_dump_threads.inc RESET MASTER; drop table t1; connection node_2; diff --git a/mysql-test/suite/galera/r/galera_restart_replica.result b/mysql-test/suite/galera/r/galera_restart_replica.result index 1691f9822a8..6bd5ba4311d 100644 --- a/mysql-test/suite/galera/r/galera_restart_replica.result +++ b/mysql-test/suite/galera/r/galera_restart_replica.result @@ -161,6 +161,7 @@ connection replica; STOP SLAVE; RESET SLAVE ALL; connection primary; +include/kill_binlog_dump_threads.inc RESET MASTER; connection node_1; disconnect primary; diff --git a/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result b/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result index 71c84d01a89..05c71ee5177 100644 --- a/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result +++ b/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result @@ -207,5 +207,6 @@ Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/t/MDEV-28053.test b/mysql-test/suite/galera/t/MDEV-28053.test index 323d7a5ba0e..894bdb4b580 100644 --- a/mysql-test/suite/galera/t/MDEV-28053.test +++ b/mysql-test/suite/galera/t/MDEV-28053.test @@ -59,4 +59,5 @@ STOP SLAVE; RESET SLAVE ALL; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_2primary_replica.test b/mysql-test/suite/galera/t/galera_2primary_replica.test index da20026f5c9..8636b4d9147 100644 --- a/mysql-test/suite/galera/t/galera_2primary_replica.test +++ b/mysql-test/suite/galera/t/galera_2primary_replica.test @@ -157,8 +157,10 @@ STOP ALL SLAVES; RESET SLAVE ALL; --connection primary1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection primary2 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_as_master.test b/mysql-test/suite/galera/t/galera_as_master.test index c19784aaa34..d288a1ea24b 100644 --- a/mysql-test/suite/galera/t/galera_as_master.test +++ b/mysql-test/suite/galera/t/galera_as_master.test @@ -71,5 +71,6 @@ CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work --connection node_1 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-test/suite/galera/t/galera_as_slave.test index e908209dc95..609e5bdf914 100644 --- a/mysql-test/suite/galera/t/galera_as_slave.test +++ b/mysql-test/suite/galera/t/galera_as_slave.test @@ -63,4 +63,5 @@ STOP SLAVE; RESET SLAVE ALL; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_as_slave_autoinc.test b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test index cb028cd8161..b84eb0c2803 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_autoinc.test +++ b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test @@ -82,4 +82,5 @@ STOP SLAVE; RESET SLAVE ALL; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.test b/mysql-test/suite/galera/t/galera_as_slave_ctas.test index d09fa0b78c3..8ace18fbdf3 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_ctas.test +++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.test @@ -72,4 +72,5 @@ STOP SLAVE; RESET SLAVE ALL; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.inc b/mysql-test/suite/galera/t/galera_as_slave_gtid.inc index 983f6ebd706..38f5898a146 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_gtid.inc +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.inc @@ -82,13 +82,16 @@ RESET SLAVE ALL; --echo #cleanup --connection node_1 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_2 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_3 +--source include/kill_binlog_dump_threads.inc reset master; diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test index 38f062b1748..2876d0629e5 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test @@ -68,19 +68,21 @@ DROP TABLE t1; --connection node_3 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; --source include/wait_condition.inc -RESET MASTER; --connection node_1 STOP SLAVE; RESET SLAVE ALL; SET GLOBAL WSREP_ON=OFF; +--source include/kill_binlog_dump_threads.inc reset master; SET GLOBAL WSREP_ON=ON; --connection node_2 SET GLOBAL WSREP_ON=OFF; +--source include/kill_binlog_dump_threads.inc reset master; SET GLOBAL WSREP_ON=ON; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test index 2769357c05e..cbb43f0138c 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test +++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test @@ -90,4 +90,5 @@ CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047"); --connection node_4 +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_circular_replication.test b/mysql-test/suite/galera/t/galera_circular_replication.test index 11dff973c00..e1f29c1b56a 100644 --- a/mysql-test/suite/galera/t/galera_circular_replication.test +++ b/mysql-test/suite/galera/t/galera_circular_replication.test @@ -221,6 +221,7 @@ RESET SLAVE ALL; --connection replica2 STOP SLAVE; RESET SLAVE ALL; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test index b326ffdffcd..726164d1b12 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave.test +++ b/mysql-test/suite/galera/t/galera_gtid_slave.test @@ -80,15 +80,18 @@ DROP TABLE t1,t2; STOP SLAVE; RESET SLAVE ALL; SET GLOBAL wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; SET GLOBAL wsrep_on=ON; --connection node_1 SET GLOBAL wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; SET GLOBAL wsrep_on=ON; --connection node_3 +--source include/kill_binlog_dump_threads.inc reset master; --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test index b54c36207cd..5c19dae80b4 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test +++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test @@ -196,6 +196,7 @@ DROP TABLE t2,t1; STOP SLAVE; RESET SLAVE ALL; set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; @@ -206,11 +207,13 @@ set global gtid_slave_pos=""; --echo #Connection 1 --connection node_1 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --echo #Connection 3 --connection node_3 +--source include/kill_binlog_dump_threads.inc reset master; --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test index e27eb5fc86a..1bd2515cc39 100644 --- a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test +++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test @@ -114,6 +114,7 @@ RESET SLAVE ALL; --connection node_1 SET SESSION WSREP_ON=OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET SESSION WSREP_ON=ON; diff --git a/mysql-test/suite/galera/t/galera_replica_no_gtid.test b/mysql-test/suite/galera/t/galera_replica_no_gtid.test index de3bbc4b276..7851bc83ba2 100644 --- a/mysql-test/suite/galera/t/galera_replica_no_gtid.test +++ b/mysql-test/suite/galera/t/galera_replica_no_gtid.test @@ -106,6 +106,7 @@ STOP SLAVE; RESET SLAVE ALL; --connection node_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; drop table t1; diff --git a/mysql-test/suite/galera/t/galera_restart_replica.test b/mysql-test/suite/galera/t/galera_restart_replica.test index d28bd0ed1f7..6706caca9b9 100644 --- a/mysql-test/suite/galera/t/galera_restart_replica.test +++ b/mysql-test/suite/galera/t/galera_restart_replica.test @@ -274,6 +274,7 @@ STOP SLAVE; RESET SLAVE ALL; --connection primary +--source include/kill_binlog_dump_threads.inc RESET MASTER; --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result index c3e233a9fb7..23412f70e53 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result @@ -75,27 +75,33 @@ RESET SLAVE; Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; SET GLOBAL GTID_SLAVE_POS=""; connection node_1; SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; connection node_2; SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; connection node_3; SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; connection node_5; SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; connection node_6; SET GLOBAL wsrep_on = OFF; +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; connection node_1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result index 36a63c87713..b3888cd1f82 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result @@ -235,6 +235,7 @@ cluster 1 node 1 connection node_1; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; @@ -242,23 +243,28 @@ cluster 2 node 1 connection node_4; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; connection node_2; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_3; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_5; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_6; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_1; @@ -448,6 +454,7 @@ drop table t1; stop slave; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; @@ -456,22 +463,27 @@ connection node_4; stop slave; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; connection node_2; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_3; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_5; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; connection node_6; set global wsrep_on=OFF; +include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test index d20b64e7c81..48f44c88176 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -138,6 +138,7 @@ DROP TABLE t1; STOP SLAVE; RESET SLAVE; SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc @@ -146,6 +147,7 @@ SET GLOBAL GTID_SLAVE_POS=""; --connection node_1 SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc @@ -153,6 +155,7 @@ SET GLOBAL wsrep_on = ON; --connection node_2 SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc @@ -160,6 +163,7 @@ SET GLOBAL wsrep_on = ON; --connection node_3 SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc @@ -167,6 +171,7 @@ SET GLOBAL wsrep_on = ON; --connection node_5 SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc @@ -174,6 +179,7 @@ SET GLOBAL wsrep_on = ON; --connection node_6 SET GLOBAL wsrep_on = OFF; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL wsrep_on = ON; --source include/wait_until_ready.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test index c0dbc7d493d..2152cd3ed40 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test @@ -170,6 +170,7 @@ reset slave; --connection node_1 change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; @@ -179,24 +180,29 @@ set global GTID_SLAVE_POS=""; --connection node_4 change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; --connection node_2 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_3 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_5 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_6 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; #--enable_parsing @@ -334,6 +340,7 @@ drop table t1; stop slave; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; @@ -343,23 +350,28 @@ set global GTID_SLAVE_POS=""; stop slave; change master to master_use_gtid=no, ignore_server_ids=(); set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; set global GTID_SLAVE_POS=""; --connection node_2 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_3 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_5 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; --connection node_6 set global wsrep_on=OFF; +--source include/kill_binlog_dump_threads.inc reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result index 7cc87530770..3f4ac49ac99 100644 --- a/mysql-test/suite/perfschema/r/relaylog.result +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -65,11 +65,13 @@ where event_name like "%MYSQL_BIN_LOG%" and event_name not like "%MYSQL_BIN_LOG::COND_xid_list" order by event_name; EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_binlog_use NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_bin_log_updated MANY wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_relay_log_updated NONE wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_background_thread MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_end_pos MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_use MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY "Expect no slave relay log" @@ -155,11 +157,13 @@ where event_name like "%MYSQL_BIN_LOG%" and event_name not like "%MYSQL_BIN_LOG::COND_xid_list" order by event_name; EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_binlog_use NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_bin_log_updated NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_relay_log_updated NONE wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_background_thread MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_end_pos MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_use MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY "Expect a slave relay log" diff --git a/mysql-test/suite/rpl/include/mysqlbinlog_slave_consistency.inc b/mysql-test/suite/rpl/include/mysqlbinlog_slave_consistency.inc index b571c24e9dc..8a171373013 100644 --- a/mysql-test/suite/rpl/include/mysqlbinlog_slave_consistency.inc +++ b/mysql-test/suite/rpl/include/mysqlbinlog_slave_consistency.inc @@ -133,6 +133,7 @@ if (!$slave_sql_errno) --connection $con1 DROP TABLE IF EXISTS t1, t2, t3, t4, t5; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo # MYSQL_BINLOG BINLOG_FILE_PARAM $msbl_args 2> MYSQLBINLOG_STDERR | MYSQL --exec $MYSQL_BINLOG $BINLOG_FILE_PARAM $msbl_args 2> $MYSQLBINLOG_STDERR | $MYSQL @@ -164,6 +165,7 @@ set global gtid_slave_pos=""; CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), IGNORE_SERVER_IDS=(); --connection $con1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; DROP TABLE IF EXISTS t1, t2, t3, t4, t5; --source include/save_master_gtid.inc @@ -178,6 +180,7 @@ set global gtid_slave_pos=""; RESET MASTER; --connection $con1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection $con2 diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_master.inc b/mysql-test/suite/rpl/include/rpl_extra_col_master.inc index 3fef3cc1fd0..ac91630f8b3 100644 --- a/mysql-test/suite/rpl/include/rpl_extra_col_master.inc +++ b/mysql-test/suite/rpl/include/rpl_extra_col_master.inc @@ -466,6 +466,7 @@ eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) --connection master eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -522,6 +523,7 @@ connection master; eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -577,6 +579,7 @@ connection master; eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -630,6 +633,7 @@ eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -701,6 +705,7 @@ DROP TABLE t14; connection master; DROP TABLE t14; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; @@ -727,6 +732,7 @@ eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -765,6 +771,7 @@ DROP TABLE t15; connection master; DROP TABLE t15; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; @@ -791,6 +798,7 @@ eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -842,6 +850,7 @@ DROP TABLE t16; connection master; DROP TABLE t16; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; @@ -869,6 +878,7 @@ eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -935,6 +945,7 @@ eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo @@ -998,6 +1009,7 @@ eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test index 028c833a6e5..96621ace68e 100644 --- a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test +++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test @@ -40,6 +40,7 @@ connection master; eval CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -81,6 +82,7 @@ eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5), connection master; eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Master Data Insert *** @@ -100,6 +102,7 @@ STOP SLAVE; SELECT * FROM t2 ORDER BY a; connection master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; @@ -126,6 +129,7 @@ eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20), connection master; eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -171,6 +175,7 @@ eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20), connection master; eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -214,6 +219,7 @@ connection master; eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT, e BLOB, f FLOAT) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -258,6 +264,7 @@ connection master; eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -317,6 +324,7 @@ eval CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5), connection master; eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -358,6 +366,7 @@ eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5), connection master; eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -408,6 +417,7 @@ sync_slave_with_master; connection master; eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE=$engine_type; + --source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -456,6 +466,7 @@ eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', connection master; eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -498,6 +509,7 @@ eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT, connection master; eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -540,6 +552,7 @@ eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, connection master; eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -581,6 +594,7 @@ eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5), connection master; eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -629,6 +643,8 @@ eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), connection master; eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -669,6 +685,7 @@ eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), connection master; eval CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -694,6 +711,7 @@ STOP SLAVE; --echo *** Master Drop c5 *** connection master; ALTER TABLE t14a DROP COLUMN c5; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -759,6 +777,7 @@ eval CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, connection master; eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -832,6 +851,7 @@ eval CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, connection master; eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5))ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** @@ -886,6 +906,7 @@ eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5), connection master; eval CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE=$engine_type; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start Slave *** diff --git a/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test index 4f907d0b012..dc917448c5f 100644 --- a/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test +++ b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test @@ -33,6 +33,7 @@ if (!$ssu_before_gtids) --source include/stop_slave.inc --source include/reset_slave.inc --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; set session gtid_domain_id=0; diff --git a/mysql-test/suite/rpl/include/rpl_loaddata.test b/mysql-test/suite/rpl/include/rpl_loaddata.test index 0a6d03aa837..a841d0f1231 100644 --- a/mysql-test/suite/rpl/include/rpl_loaddata.test +++ b/mysql-test/suite/rpl/include/rpl_loaddata.test @@ -115,6 +115,7 @@ stop slave; # Finally, see if logging is done ok on master for a failing LOAD DATA INFILE connection master; +--source include/kill_binlog_dump_threads.inc reset master; eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=$engine_type; # no transactions diff --git a/mysql-test/suite/rpl/include/rpl_parallel_29322.inc b/mysql-test/suite/rpl/include/rpl_parallel_29322.inc index a8b729d0cb5..3ef5fdb5c00 100644 --- a/mysql-test/suite/rpl/include/rpl_parallel_29322.inc +++ b/mysql-test/suite/rpl/include/rpl_parallel_29322.inc @@ -25,6 +25,7 @@ --connection master --let $datadir= `SELECT @@datadir` +--source include/kill_binlog_dump_threads.inc reset master; # Master starts a new serious of binlog files create table t2 (a timestamp, b int); 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 56b04494a7c..ded7743e313 100644 --- a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test @@ -187,13 +187,15 @@ sync_slave_with_master; # Testing how out of valid range position value is handled with an error. # +--connection slave +--source include/stop_slave.inc --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1); let $master_pos= `SELECT $master_pos + 1`; --connection slave ---source include/stop_slave.inc --replace_regex /[0-9]+/MASTER_POS/ eval CHANGE MASTER TO master_log_pos=$master_pos, master_use_gtid=no; @@ -211,6 +213,7 @@ START SLAVE; RESET SLAVE; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Slave is stopped by bug#3593869-64035 tests. diff --git a/mysql-test/suite/rpl/r/rpl_binlog_directory.result b/mysql-test/suite/rpl/r/rpl_binlog_directory.result index f58e9c470fd..6434179184c 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_directory.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_directory.result @@ -40,6 +40,7 @@ connection slave; include/stop_slave.inc SET GLOBAL gtid_slave_pos= ''; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result index 442b2a5da1d..dddf26aa0b9 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result @@ -13,6 +13,7 @@ call mtr.add_suppression("Could not use master-bin for logging"); SET @old_debug= @@global.debug_dbug; SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data'; SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data'; +include/kill_binlog_dump_threads.inc RESET MASTER; ###################### TEST #1 FLUSH LOGS; @@ -273,5 +274,6 @@ Note 1255 Slave already has been stopped RESET SLAVE; Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' +include/kill_binlog_dump_threads.inc RESET MASTER; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result index 33f479ba2c1..5df65903a9b 100644 --- a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result +++ b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result @@ -1,8 +1,13 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +connection master; +include/kill_binlog_dump_threads.inc SET timestamp=1000000000; RESET MASTER; connection slave; +include/start_slave.inc SET timestamp=1000000000; RESET MASTER; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result index 7d676ea73e3..81187a39356 100644 --- a/mysql-test/suite/rpl/r/rpl_bug41902.result +++ b/mysql-test/suite/rpl/r/rpl_bug41902.result @@ -20,6 +20,7 @@ SET @@debug_dbug=""; reset slave; change master to master_host='dummy'; connection master; +include/kill_binlog_dump_threads.inc SET @saved_dbug_m = @@global.debug_dbug; SET @@debug_dbug="d,simulate_find_log_pos_error"; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_change_master_demote.result b/mysql-test/suite/rpl/r/rpl_change_master_demote.result index a1ea32e9b10..29c71f57bb8 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master_demote.result +++ b/mysql-test/suite/rpl/r/rpl_change_master_demote.result @@ -65,11 +65,15 @@ connection master; # connection slave; include/stop_slave.inc +include/kill_binlog_dump_threads.inc RESET MASTER; set @@global.gtid_slave_pos=""; +connection master; +include/kill_binlog_dump_threads.inc +RESET MASTER; +connection slave; include/start_slave.inc connection master; -RESET MASTER; set @@global.gtid_slave_pos=""; set session gtid_domain_id= 0; CREATE TABLE t1 (a int); @@ -689,6 +693,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp # Ensure MASTER_DEMOTE_TO_REPLICA aliases MASTER_DEMOTE_TO_SLAVE # connection slave; +include/kill_binlog_dump_threads.inc RESET MASTER; include/reset_slave.inc CREATE TABLE t_mdev_31768 (a int); @@ -700,6 +705,7 @@ RESET MASTER; include/reset_slave.inc # Clear primary binlog state to match replica connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; # # Cleanup diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index 39ebb85b9e9..8ebaea3ddc1 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -134,6 +134,7 @@ set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); flush logs; connection master; set @@global.binlog_checksum= CRC32; +include/kill_binlog_dump_threads.inc reset master; flush logs; create table t3 (a int, b char(5)); @@ -148,6 +149,7 @@ include/stop_slave.inc change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; connection master; flush logs; +include/kill_binlog_dump_threads.inc reset master; insert into t3 value (1, @@global.binlog_checksum); connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 85cc0cc7ebc..ea1932f41ed 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -181,6 +181,7 @@ DELETE FROM t1 WHERE a = 6; include/start_slave.inc connection server_2; connection server_3; +include/kill_binlog_dump_threads.inc RESET MASTER; connection server_4; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result index 9dd4aed2d29..8c762a591ec 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result @@ -6,11 +6,13 @@ call mtr.add_suppression("Timeout waiting for reply of binlog"); connection server_2; include/stop_slave.inc connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; set @@session.gtid_domain_id=10; set @@global.rpl_semi_sync_master_enabled = 1; set @@global.rpl_semi_sync_master_wait_point=AFTER_SYNC; connection server_2; +include/kill_binlog_dump_threads.inc RESET MASTER; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; set @@session.gtid_domain_id=20; diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result index 95a30c6ee4d..adb64d13502 100644 --- a/mysql-test/suite/rpl/r/rpl_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_colSize.result @@ -53,6 +53,7 @@ r TEXT, s MEDIUMTEXT, t LONGTEXT ); +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start replication *** connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_delayed_slave.result b/mysql-test/suite/rpl/r/rpl_delayed_slave.result index 7ac68e25ac5..35d7f40800b 100644 --- a/mysql-test/suite/rpl/r/rpl_delayed_slave.result +++ b/mysql-test/suite/rpl/r/rpl_delayed_slave.result @@ -164,6 +164,7 @@ Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' [on master] connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; [on slave] connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index 145b269aac9..f40b2b85405 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -448,6 +448,7 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) connection master; CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -490,6 +491,7 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) connection master; CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -532,6 +534,7 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB connection master; CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -583,6 +586,7 @@ CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -644,6 +648,7 @@ include/reset_slave.inc DROP TABLE t14; connection master; DROP TABLE t14; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -667,6 +672,7 @@ CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -703,6 +709,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat DROP TABLE t15; connection master; DROP TABLE t15; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -726,6 +733,7 @@ CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -762,6 +770,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat DROP TABLE t16; connection master; DROP TABLE t16; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -785,6 +794,7 @@ CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -851,6 +861,7 @@ CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -916,6 +927,7 @@ CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 LONG, c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index dae497d5f29..f9f195af64a 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -448,6 +448,7 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) connection master; CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -490,6 +491,7 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) connection master; CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -532,6 +534,7 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB connection master; CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -583,6 +586,7 @@ CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -644,6 +648,7 @@ include/reset_slave.inc DROP TABLE t14; connection master; DROP TABLE t14; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -667,6 +672,7 @@ CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -703,6 +709,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat DROP TABLE t15; connection master; DROP TABLE t15; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -726,6 +733,7 @@ CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -762,6 +770,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat DROP TABLE t16; connection master; DROP TABLE t16; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -785,6 +794,7 @@ CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -851,6 +861,7 @@ CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** @@ -916,6 +927,7 @@ CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 LONG, c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index 5a9eb5ee198..2041625c7c1 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -16,6 +16,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -51,6 +52,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Master Data Insert *** connection master; @@ -72,6 +74,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat SELECT * FROM t2 ORDER BY a; a b c d e connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -90,6 +93,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -120,6 +124,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -149,6 +154,7 @@ connection master; CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT, e BLOB, f FLOAT) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -177,6 +183,7 @@ connection master; CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -209,6 +216,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -244,6 +252,7 @@ e INT)ENGINE='InnoDB'; connection master; CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -270,6 +279,7 @@ i blob) ENGINE='InnoDB'; connection master; CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -297,6 +307,7 @@ c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; connection master; CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -325,6 +336,7 @@ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; connection master; CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -353,6 +365,7 @@ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; connection master; CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -391,6 +404,7 @@ e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -429,6 +443,8 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -465,6 +481,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -493,6 +510,7 @@ include/reset_slave.inc *** Master Drop c5 *** connection master; ALTER TABLE t14a DROP COLUMN c5; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -558,6 +576,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -626,6 +645,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5))ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -697,6 +717,7 @@ ENGINE='InnoDB'; connection master; CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='InnoDB'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result index adbee24d852..cdbf01e033a 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result @@ -11,6 +11,7 @@ d char(10) as (concat(trim(c), '-U')) unique, e char(10) as (concat('S', b)) stored) engine=innodb; connection master; create table t1 (a int primary key, b blob, c char(5)) engine=innodb; +include/kill_binlog_dump_threads.inc reset master; connection slave; start slave; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index d0fb5a305f8..199f3874391 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -16,6 +16,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -51,6 +52,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Master Data Insert *** connection master; @@ -72,6 +74,7 @@ Warning 1948 Specified value for @@gtid_slave_pos contains no value for replicat SELECT * FROM t2 ORDER BY a; a b c d e connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -90,6 +93,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -120,6 +124,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -149,6 +154,7 @@ connection master; CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT, e BLOB, f FLOAT) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -177,6 +183,7 @@ connection master; CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -209,6 +216,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -244,6 +252,7 @@ e INT)ENGINE='MyISAM'; connection master; CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -270,6 +279,7 @@ i blob) ENGINE='MyISAM'; connection master; CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -297,6 +307,7 @@ c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; connection master; CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -325,6 +336,7 @@ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; connection master; CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -353,6 +365,7 @@ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; connection master; CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -391,6 +404,7 @@ e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -429,6 +443,8 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -465,6 +481,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -493,6 +510,7 @@ include/reset_slave.inc *** Master Drop c5 *** connection master; ALTER TABLE t14a DROP COLUMN c5; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -558,6 +576,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -626,6 +645,7 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP connection master; CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5))ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; @@ -697,6 +717,7 @@ ENGINE='MyISAM'; connection master; CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='MyISAM'; +include/kill_binlog_dump_threads.inc RESET MASTER; *** Start Slave *** connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index afc700a72c5..42a171d496b 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -197,6 +197,7 @@ connection server_1; SET @old_state= @@GLOBAL.gtid_binlog_state; SET GLOBAL gtid_binlog_state = ''; ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL gtid_binlog_state = ''; FLUSH LOGS; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index f46c17db3fc..41cd35b3863 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -43,6 +43,7 @@ include/stop_slave.inc RESET MASTER; SET GLOBAL gtid_slave_pos=''; connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1; Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result index c62760ac4d0..1d6332cb76f 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result @@ -93,6 +93,7 @@ SET SESSION binlog_format= @old_mode; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (4); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result b/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result index 6731abc27b7..c733c67f886 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result @@ -32,6 +32,7 @@ include/wait_for_slave_sql_error.inc [errno=1594] STOP SLAVE IO_THREAD; # Reset master binlogs (as there is an invalid event) and slave state connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; RESET MASTER; @@ -58,6 +59,7 @@ STOP SLAVE IO_THREAD; set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; # Reset master binlogs (as there is an invalid event) and slave state connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; RESET MASTER; @@ -84,6 +86,7 @@ STOP SLAVE IO_THREAD; set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; # Reset master binlogs (as there is an invalid event) and slave state connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; RESET MASTER; @@ -105,6 +108,7 @@ include/wait_for_slave_sql_error.inc [errno=1594] STOP SLAVE IO_THREAD; # Reset master binlogs (as there is an invalid event) and slave state connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; RESET SLAVE; @@ -128,6 +132,7 @@ include/wait_for_slave_sql_error.inc [errno=1594] STOP SLAVE IO_THREAD; # Reset master binlogs (as there is an invalid event) and slave state connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index 5fba9966a43..8227011f6fb 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -18,6 +18,7 @@ include/stop_slave.inc connection server_1; INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); +include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; connection server_2; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result index f9d6cd3b743..ce96cb7348a 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result @@ -43,6 +43,7 @@ SET GLOBAL gtid_slave_pos= ""; connection server_1; SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +include/kill_binlog_dump_threads.inc RESET MASTER; SET gtid_domain_id=10; SET gtid_seq_no=50; @@ -91,6 +92,7 @@ SET GLOBAL gtid_slave_pos= ""; connection server_1; SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +include/kill_binlog_dump_threads.inc RESET MASTER; include/kill_binlog_dump_threads.inc SET gtid_domain_id= 9; @@ -143,6 +145,7 @@ SET GLOBAL gtid_slave_pos= ""; connection server_1; SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +include/kill_binlog_dump_threads.inc RESET MASTER; include/kill_binlog_dump_threads.inc SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_sort.result b/mysql-test/suite/rpl/r/rpl_gtid_sort.result index 46a65e7d865..6630a802248 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_sort.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_sort.result @@ -17,6 +17,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_state'; Variable_name Value gtid_binlog_state connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; FLUSH LOGS; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result index f271e730921..0f0de0c4f65 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result @@ -5,6 +5,7 @@ include/stop_slave.inc RESET MASTER; RESET SLAVE; connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; FLUSH LOGS; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; @@ -92,6 +93,7 @@ include/stop_slave.inc RESET SLAVE ALL; RESET MASTER; connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; connection server_2; SET GLOBAL gtid_slave_pos=''; @@ -199,6 +201,7 @@ include/stop_slave.inc RESET MASTER; SET GLOBAL gtid_slave_pos=""; connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; TRUNCATE TABLE t1; INSERT INTO t1 VALUES (10); @@ -244,6 +247,7 @@ SET GLOBAL gtid_slave_pos= ""; CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=no, master_log_file="", master_log_pos= 4; connection server_1; DROP TABLE t1; +include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t1 (a INT PRIMARY KEY); connection server_2; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result index 029d2367e50..3169bff2622 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_until.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result @@ -206,6 +206,7 @@ RESET SLAVE ALL; RESET MASTER; SET GLOBAL gtid_slave_pos=''; connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (11); diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index 42cf90bc738..2b012face8d 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -1,9 +1,11 @@ include/master-slave.inc [connection master] -connection master; -reset master; connection slave; include/stop_slave.inc +connection master; +include/kill_binlog_dump_threads.inc +reset master; +connection slave; set @restore_slave_net_timeout= @@global.slave_net_timeout; set @@global.slave_net_timeout= 10; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index a9bd16cc85a..3ec4bab2572 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -7,6 +7,7 @@ include/stop_slave.inc RESET SLAVE; SET @restore_slave_net_timeout=@@global.slave_net_timeout; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @restore_slave_net_timeout=@@global.slave_net_timeout; @@ -268,6 +269,7 @@ DROP TABLE t1; set sql_log_bin= 1; connection master; DROP TABLE t1; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5; @@ -293,9 +295,12 @@ connection slave; STOP SLAVE; include/reset_slave.inc CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; +connection master; +include/kill_binlog_dump_threads.inc +RESET MASTER; +connection slave; include/start_slave.inc connection master; -RESET MASTER; connection slave; Heartbeat events are received after reset of master (1 means 'yes'): 1 diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result index cc11f481991..a7fbda34a95 100644 --- a/mysql-test/suite/rpl/r/rpl_ip_mix.result +++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result @@ -2,6 +2,7 @@ connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT; connection master; +include/kill_binlog_dump_threads.inc reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB @@ -18,6 +19,7 @@ connection default; connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT; connection master; +include/kill_binlog_dump_threads.inc reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB @@ -34,6 +36,7 @@ connection default; connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT; connection master; +include/kill_binlog_dump_threads.inc reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result index 5ad4b3eacc5..cdf50dc2f53 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result @@ -1,6 +1,7 @@ #################### IP: 127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -16,6 +17,7 @@ connection default; #################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -31,6 +33,7 @@ connection default; #################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -46,6 +49,7 @@ connection default; #################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -61,6 +65,7 @@ connection default; #################### IP: 0::0000:FFFF:127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -76,6 +81,7 @@ connection default; #################### IP: ::FFFF:127.0.0.1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result index fc9171d8b37..2ffddfa8f21 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv6.result @@ -1,6 +1,7 @@ #################### IP: ::1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -16,6 +17,7 @@ connection default; #################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; @@ -31,6 +33,7 @@ connection default; #################### IP: 0:0:0:0:0:0:0:1 ########################### connect master,$IPv6,root,,test,$MASTER_MYPORT; connect slave,$IPv6,root,,test,$SLAVE_MYPORT; +include/kill_binlog_dump_threads.inc connection master; reset master; show master status; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index 0be197642e9..d7c01665615 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -62,6 +62,7 @@ Warnings: Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-14. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=MyISAM; diff --git a/mysql-test/suite/rpl/r/rpl_mdev_17614.result b/mysql-test/suite/rpl/r/rpl_mdev_17614.result index 7e2e8727b45..779bfac0faa 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev_17614.result +++ b/mysql-test/suite/rpl/r/rpl_mdev_17614.result @@ -32,6 +32,7 @@ a b c include/stop_slave_io.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; drop table t1; connection slave; @@ -191,6 +192,7 @@ a b c include/stop_slave_io.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; drop table t1; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_mysqlbinlog_slave_consistency.result b/mysql-test/suite/rpl/r/rpl_mysqlbinlog_slave_consistency.result index e69fb2fc62d..56aa84b46ed 100644 --- a/mysql-test/suite/rpl/r/rpl_mysqlbinlog_slave_consistency.result +++ b/mysql-test/suite/rpl/r/rpl_mysqlbinlog_slave_consistency.result @@ -7,6 +7,7 @@ call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be SET sql_log_bin=1; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; include/start_slave.inc @@ -1336,8 +1337,10 @@ ERROR HY000: Could not initialize master info structure for ''; more error messa RESET MASTER; set global gtid_slave_pos=""; CHANGE MASTER TO MASTER_USE_GTID=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(); -include/start_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; +connection slave; +include/start_slave.inc include/rpl_end.inc # End of tests (rpl.rpl_mysqlbinlog_slave_consistency) diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index bb6269607fe..3f62e585ad5 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -65,6 +65,7 @@ Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @max_allowed_packet_0= @@session.max_allowed_packet; SHOW BINLOG EVENTS; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_29322.result b/mysql-test/suite/rpl/r/rpl_parallel_29322.result index 781804100e0..bdc690765c4 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_29322.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_29322.result @@ -20,6 +20,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (a timestamp, b int); show create table t2; @@ -117,6 +118,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (a timestamp, b int); show create table t2; @@ -211,6 +213,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (a timestamp, b int); show create table t2; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_until.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_until.result index a83a9b61b9f..593f32469e9 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_until.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_until.result @@ -5,6 +5,7 @@ include/stop_slave.inc RESET MASTER; RESET SLAVE; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t1 (a int primary key, b text) ENGINE=InnoDB; INSERT INTO t1 SET a=25, b='trx0'; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_seq.result b/mysql-test/suite/rpl/r/rpl_parallel_seq.result index 02287d54e33..4ca13e6166a 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_seq.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_seq.result @@ -48,6 +48,7 @@ Note 1255 Slave already has been stopped RESET MASTER; SET @@global.gtid_slave_pos=""; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE ti (a INT) ENGINE=innodb; CREATE SEQUENCE s2 ENGINE=innodb; diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result index ffffb580518..2ebfa90456f 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result @@ -50,9 +50,12 @@ include/assert.inc [Value returned by SSS and PS table for Last_Error_Number sho Value returned by SSS and PS table for Last_Error_Message is same. connection master; drop table t; -reset master; connection slave; include/stop_slave.inc +connection master; +include/kill_binlog_dump_threads.inc +reset master; +connection slave; reset slave; reset master; set @@global.gtid_slave_pos= ""; diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result index 8180d0c0f44..6129f1276ea 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result @@ -82,6 +82,7 @@ include/stop_slave.inc RESET SLAVE; connection master; DROP TABLE t; +include/kill_binlog_dump_threads.inc RESET MASTER; # Verify that number of rows in 'replication_applier_status_by_worker' table match with diff --git a/mysql-test/suite/rpl/r/rpl_reset_master.result b/mysql-test/suite/rpl/r/rpl_reset_master.result new file mode 100644 index 00000000000..07174433ac3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_reset_master.result @@ -0,0 +1,36 @@ +include/master-slave.inc +[connection master] +connection master; +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +FLUSH BINARY LOGS; +INSERT INTO t1 VALUES (2); +*** Test that RESET MASTER fails when a slave is connected. +RESET MASTER; +ERROR HY000: Cannot execute RESET MASTER as the binlog is in use by a connected slave or other RESET MASTER or binlog reader. Check SHOW PROCESSLIST for "Binlog Dump" commands and use KILL to stop such readers +connection master; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +*** Test that RESET MASTER fails on concurrent SHOW BINLOG EVENTS. +include/kill_binlog_dump_threads.inc +connection master1; +SET debug_sync= 'after_show_binlog_events SIGNAL waiting WAIT_FOR go'; +SHOW BINLOG EVENTS in 'master-bin.000001'; +connection master; +SET debug_sync= 'now WAIT_FOR waiting'; +RESET MASTER; +SET debug_sync= 'now SIGNAL go'; +connection master1; +connection master; +*** RESET MASTER works when no concurrent reader. +RESET MASTER; +DROP TABLE t1; +include/save_master_gtid.inc +connection slave; +SET GLOBAL gtid_slave_pos= ''; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result index 926404d29be..f5813ed49d8 100644 --- a/mysql-test/suite/rpl/r/rpl_row_001.result +++ b/mysql-test/suite/rpl/r/rpl_row_001.result @@ -2,10 +2,11 @@ include/master-slave.inc [connection master] CREATE TABLE t1 (n INT); connection slave; +include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; -STOP SLAVE; include/reset_slave.inc connection master; SELECT COUNT(*) FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index dbfb9325f9c..3c78409e077 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -15,6 +15,7 @@ include/reset_slave.inc CREATE TABLE t1 (a DECIMAL(5,2)); connection master; CREATE TABLE t1 (a DECIMAL(20, 10)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (901251.90125); connection slave; @@ -29,6 +30,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -42,6 +44,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a DECIMAL(27, 9)); connection master; CREATE TABLE t1 (a DECIMAL(27, 18)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (901251.90125); connection slave; @@ -56,6 +59,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -69,6 +73,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a NUMERIC(5,2)); connection master; CREATE TABLE t1 (a NUMERIC(20, 10)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (901251.90125); connection slave; @@ -83,6 +88,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -97,6 +103,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a FLOAT(20)); connection master; CREATE TABLE t1 (a FLOAT(47)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (901251.90125); connection slave; @@ -111,6 +118,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -125,6 +133,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a BIT(5)); connection master; CREATE TABLE t1 (a BIT(64)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (B'10101'); connection slave; @@ -139,6 +148,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -152,6 +162,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a BIT(11)); connection master; CREATE TABLE t1 (a BIT(12)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (B'10101'); connection slave; @@ -166,6 +177,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -180,6 +192,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a SET('4')); connection master; CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9')); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('4'); connection slave; @@ -194,6 +207,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -208,6 +222,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a CHAR(10)); connection master; CREATE TABLE t1 (a CHAR(20)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); connection slave; @@ -222,6 +237,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -267,6 +283,7 @@ CREATE TABLE t1 (a ENUM( '281','282','283','284','285','286','287','288','289', '291','292','293','294','295','296','297','298','299' )); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('44'); connection slave; @@ -281,6 +298,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -295,6 +313,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a VARCHAR(100)); connection master; CREATE TABLE t1 (a VARCHAR(2000)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); connection slave; @@ -309,6 +328,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -322,6 +342,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a VARCHAR(10)); connection master; CREATE TABLE t1 (a VARCHAR(200)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); connection slave; @@ -336,6 +357,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -349,6 +371,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a VARCHAR(1000)); connection master; CREATE TABLE t1 (a VARCHAR(2000)); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); connection slave; @@ -363,6 +386,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; @@ -377,6 +401,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' CREATE TABLE t1 (a TINYBLOB); connection master; CREATE TABLE t1 (a LONGBLOB); +include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); connection slave; @@ -391,6 +416,7 @@ include/reset_slave.inc Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result index bf63dc57c4b..7044e95aefe 100644 --- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result @@ -80,6 +80,7 @@ Warnings: Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=MyISAM; diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index 817b9b12c59..1464dba606a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -89,6 +89,7 @@ connection slave; stop slave; include/wait_for_slave_to_stop.inc connection master; +include/kill_binlog_dump_threads.inc reset master; connection slave; include/reset_slave.inc @@ -219,6 +220,7 @@ connection slave; stop slave; include/wait_for_slave_to_stop.inc connection master; +include/kill_binlog_dump_threads.inc reset master; connection slave; include/reset_slave.inc @@ -354,6 +356,7 @@ connection slave; stop slave; include/wait_for_slave_to_stop.inc connection master; +include/kill_binlog_dump_threads.inc reset master; connection slave; include/reset_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 03e3443b31e..44dbec183eb 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -20,6 +20,7 @@ include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; +include/kill_binlog_dump_threads.inc reset master; set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -301,8 +302,10 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; +include/stop_slave.inc [ test reset master ] connection master; +include/kill_binlog_dump_threads.inc reset master; show status like 'Rpl_semi_sync_master_status'; Variable_name Value @@ -314,7 +317,6 @@ show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; -include/stop_slave.inc include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; @@ -349,6 +351,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; include/kill_binlog_dump_threads.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result index a79b372f937..df872b40e46 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result @@ -21,6 +21,7 @@ include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; +include/kill_binlog_dump_threads.inc reset master; set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -302,8 +303,10 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; +include/stop_slave.inc [ test reset master ] connection master; +include/kill_binlog_dump_threads.inc reset master; show status like 'Rpl_semi_sync_master_status'; Variable_name Value @@ -315,7 +318,6 @@ show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; -include/stop_slave.inc include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; @@ -350,6 +352,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; include/kill_binlog_dump_threads.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result index 393c9c55a0d..a46eeef3d8b 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result @@ -21,6 +21,7 @@ include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; +include/kill_binlog_dump_threads.inc reset master; set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -302,8 +303,10 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; +include/stop_slave.inc [ test reset master ] connection master; +include/kill_binlog_dump_threads.inc reset master; show status like 'Rpl_semi_sync_master_status'; Variable_name Value @@ -315,7 +318,6 @@ show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; -include/stop_slave.inc include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; @@ -350,6 +352,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; include/kill_binlog_dump_threads.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result index b751c0873fa..0ac50b531f9 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result @@ -3,6 +3,7 @@ include/master-slave.inc connection server_2; include/stop_slave.inc connection server_1; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @@global.max_binlog_size= 4096; set @@global.rpl_semi_sync_master_enabled = 1; @@ -276,9 +277,11 @@ include/stop_slave.inc set global rpl_semi_sync_slave_enabled = 0; set global rpl_semi_sync_master_enabled = 0; set global rpl_semi_sync_master_wait_point=default; +include/kill_binlog_dump_threads.inc RESET MASTER; RESET SLAVE; connection server_2; +include/kill_binlog_dump_threads.inc RESET MASTER; RESET SLAVE; set @@global.rpl_semi_sync_master_enabled = 0; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_semi_sync_gtid_reconnect.result index 4285228f162..0a72904fea3 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_gtid_reconnect.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_gtid_reconnect.result @@ -1,10 +1,12 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; connection slave; -include/stop_slave.inc SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1; include/start_slave.inc connection master; @@ -22,6 +24,7 @@ include/sync_slave_io_with_master.inc connection slave; include/stop_slave_io.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET @@global.gtid_binlog_state = '0-1-2'; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result index 3d8eeb02ca6..033643177fc 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id2.result +++ b/mysql-test/suite/rpl/r/rpl_server_id2.result @@ -20,6 +20,7 @@ stop slave; include/wait_for_slave_to_stop.inc drop table t1; connection master; +include/kill_binlog_dump_threads.inc reset master; create table t1(n int); create table t2(n int); diff --git a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result index 0ede17132df..8452d175bed 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result +++ b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result @@ -32,6 +32,7 @@ include/wait_for_slave_sql_to_stop.inc RESET REPLICA ALL; set @@global.gtid_slave_pos= ""; connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t(f INT) ENGINE=INNODB; INSERT INTO t VALUES (10); diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index 8896199f499..417a1a6f95e 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -65,6 +65,7 @@ STOP SLAVE; include/wait_for_slave_to_stop.inc include/reset_slave.inc connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; SET @foo = 12; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_7.result b/mysql-test/suite/rpl/r/rpl_start_alter_7.result index df7664d4aa2..93895612c91 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_7.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_7.result @@ -362,10 +362,12 @@ SET GLOBAL gtid_slave_pos= ''; connection server_1; set global binlog_alter_two_phase=0;; set global gtid_domain_id= 0; +include/kill_binlog_dump_threads.inc reset master; connection server_2; set global gtid_domain_id= 0; set global binlog_alter_two_phase=0; +include/kill_binlog_dump_threads.inc reset master; disconnect server_1; disconnect server_2; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_8.result b/mysql-test/suite/rpl/r/rpl_start_alter_8.result index 406f2d1f6fc..635c612fbaa 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_8.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_8.result @@ -356,10 +356,12 @@ SET GLOBAL gtid_slave_pos= ''; connection server_1; set global binlog_alter_two_phase=0;; set global gtid_domain_id= 0; +include/kill_binlog_dump_threads.inc reset master; connection server_2; set global gtid_domain_id= 0; set global binlog_alter_two_phase=0;; +include/kill_binlog_dump_threads.inc reset master; disconnect server_1; disconnect server_2; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result index b11804ed1c7..630bd4e325b 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result @@ -161,6 +161,7 @@ connection master; select @@gtid_binlog_state; @@gtid_binlog_state 0-1-410 +include/kill_binlog_dump_threads.inc RESET master; connection slave; select @@gtid_binlog_state; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result index 55bec7d3998..fc9d06e94e6 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result @@ -413,10 +413,12 @@ SET GLOBAL gtid_slave_pos= ''; connection server_1; SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase; SET GLOBAL gtid_domain_id= 0; +include/kill_binlog_dump_threads.inc RESET MASTER; connection server_2; SET GLOBAL gtid_domain_id= 0; SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase; +include/kill_binlog_dump_threads.inc RESET MASTER; disconnect server_1; disconnect server_2; diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index 5d6d61d175b..0e2abbfbf23 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -45,10 +45,11 @@ connection slave; connection master; create table t1 (n int); connection slave; +stop slave; connection master; +include/kill_binlog_dump_threads.inc reset master; connection slave; -stop slave; include/reset_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index a437b66dd78..bb66a0d8142 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -79,6 +79,7 @@ Warnings: Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-14. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; +include/kill_binlog_dump_threads.inc reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=MyISAM; 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 9575ea89892..6ede72aa89d 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 @@ -100,10 +100,12 @@ include/start_slave.inc connection master; DROP TABLE t1; connection slave; -connection master; -RESET MASTER; connection slave; include/stop_slave.inc +connection master; +include/kill_binlog_dump_threads.inc +RESET MASTER; +connection slave; CHANGE MASTER TO master_log_pos=MASTER_POS, master_use_gtid=no; START SLAVE; include/wait_for_slave_param.inc [Last_IO_Errno] @@ -114,6 +116,7 @@ RESET SLAVE; Warnings: Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index b51e3d847e3..2e717970a87 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -75,6 +75,7 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; connection master; drop table if exists t1; +include/kill_binlog_dump_threads.inc reset master; create table t1 (a int primary key auto_increment); connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_system_versioning_partitions.result b/mysql-test/suite/rpl/r/rpl_system_versioning_partitions.result index 8edc6996a05..6718bcaf05c 100644 --- a/mysql-test/suite/rpl/r/rpl_system_versioning_partitions.result +++ b/mysql-test/suite/rpl/r/rpl_system_versioning_partitions.result @@ -2,9 +2,15 @@ include/master-slave.inc [connection master] # # Initialize system-versioned and partitioned table and its data +connection slave; +include/stop_slave.inc connection master; SET timestamp=UNIX_TIMESTAMP('2025-01-01 01:00:00.000000'); +include/kill_binlog_dump_threads.inc RESET MASTER; +connection slave; +include/start_slave.inc +connection master; create table t1 (x int) engine=InnoDB with system versioning partition by system_time limit 3 partitions 5; insert into t1 values(1); insert into t1 values(2); diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result index d1978102f4e..0dcefccbaa4 100644 --- a/mysql-test/suite/rpl/r/rpl_timezone.result +++ b/mysql-test/suite/rpl/r/rpl_timezone.result @@ -141,6 +141,7 @@ SET @@session.time_zone = default; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc reset master; CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL); SET @@session.time_zone='+01:00'; diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result index f4f700ac477..9ca7363417d 100644 --- a/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-test/suite/rpl/r/rpl_trigger.result @@ -1006,6 +1006,7 @@ SHOW TABLES LIKE 't_'; Tables_in_test (t_) SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; START SLAVE; diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result index 8287b8feab5..1de77de60d0 100644 --- a/mysql-test/suite/rpl/r/semisync_future-7591.result +++ b/mysql-test/suite/rpl/r/semisync_future-7591.result @@ -11,6 +11,7 @@ start slave; include/wait_for_slave_io_error.inc [errno=1236] connection master; insert into t1 values (1); +include/kill_binlog_dump_threads.inc reset master; connection slave; include/stop_slave_sql.inc diff --git a/mysql-test/suite/rpl/t/rpl_binlog_directory.test b/mysql-test/suite/rpl/t/rpl_binlog_directory.test index 4c6e6592e4d..0f47972155c 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_directory.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_directory.test @@ -54,6 +54,7 @@ SELECT * FROM t1 ORDER BY a; SET GLOBAL gtid_slave_pos= ''; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --rmdir $master_datadir/binlog_dir diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test index 25f426d4911..1e3dab7d966 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test @@ -77,6 +77,7 @@ SET @old_debug= @@global.debug_dbug; --enable_ps2_protocol --enable_cursor_protocol +--source include/kill_binlog_dump_threads.inc RESET MASTER; -- echo ###################### TEST #1 @@ -444,6 +445,7 @@ call mtr.add_suppression("Can't generate a unique log-filename .*"); ### clean up -- source include/stop_slave_sql.inc RESET SLAVE; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --remove_file $load_file --remove_file $load_file2 diff --git a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test index f7aefd625a1..38e9a9f92f3 100644 --- a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test +++ b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test @@ -25,9 +25,14 @@ source include/have_binlog_format_row.inc; source include/binlog_start_pos.inc; source include/master-slave.inc; +connection slave; +source include/stop_slave.inc; +connection master; +source include/kill_binlog_dump_threads.inc; SET timestamp=1000000000; RESET MASTER; connection slave; +source include/start_slave.inc; SET timestamp=1000000000; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_bug41902.test b/mysql-test/suite/rpl/t/rpl_bug41902.test index bb6c572580f..9b80d5bfd46 100644 --- a/mysql-test/suite/rpl/t/rpl_bug41902.test +++ b/mysql-test/suite/rpl/t/rpl_bug41902.test @@ -36,6 +36,7 @@ reset slave; change master to master_host='dummy'; connection master; +--source include/kill_binlog_dump_threads.inc SET @saved_dbug_m = @@global.debug_dbug; SET @@debug_dbug="d,simulate_find_log_pos_error"; --error ER_UNKNOWN_TARGET_BINLOG diff --git a/mysql-test/suite/rpl/t/rpl_change_master_demote.test b/mysql-test/suite/rpl/t/rpl_change_master_demote.test index 255e9e34b9c..0f6adfc88ec 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master_demote.test +++ b/mysql-test/suite/rpl/t/rpl_change_master_demote.test @@ -104,11 +104,15 @@ change master to master_use_gtid=slave_pos; --echo # --connection slave --source include/stop_slave.inc +--source include/kill_binlog_dump_threads.inc RESET MASTER; set @@global.gtid_slave_pos=""; +--connection master +--source include/kill_binlog_dump_threads.inc +RESET MASTER; +--connection slave --source include/start_slave.inc --connection master -RESET MASTER; set @@global.gtid_slave_pos=""; set session gtid_domain_id= 0; CREATE TABLE t1 (a int); @@ -482,6 +486,7 @@ EOF --echo # Ensure MASTER_DEMOTE_TO_REPLICA aliases MASTER_DEMOTE_TO_SLAVE --echo # --connection slave +--source include/kill_binlog_dump_threads.inc RESET MASTER; --source include/reset_slave.inc CREATE TABLE t_mdev_31768 (a int); @@ -505,6 +510,7 @@ RESET MASTER; --echo # Clear primary binlog state to match replica --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test index bea325b251f..1ec75d0bb2e 100644 --- a/mysql-test/suite/rpl/t/rpl_checksum.test +++ b/mysql-test/suite/rpl/t/rpl_checksum.test @@ -214,6 +214,7 @@ flush logs; connection master; set @@global.binlog_checksum= CRC32; +--source include/kill_binlog_dump_threads.inc reset master; flush logs; create table t3 (a int, b char(5)); @@ -232,6 +233,7 @@ eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master connection master; flush logs; +--source include/kill_binlog_dump_threads.inc reset master; insert into t3 value (1, @@global.binlog_checksum); diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index aeb849b893e..f78b86b679a 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -197,6 +197,7 @@ DELETE FROM t1 WHERE a = 6; --source include/start_slave.inc --connection server_2 --sync_slave_with_master server_3 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --let $file_d= query_get_value(SHOW MASTER STATUS, File, 1) --let $pos_d= query_get_value(SHOW MASTER STATUS, Position, 1) diff --git a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test index 75d04d6545b..5304a4b49ac 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test @@ -26,12 +26,14 @@ call mtr.add_suppression("Timeout waiting for reply of binlog"); # Initial master --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; set @@session.gtid_domain_id=10; set @@global.rpl_semi_sync_master_enabled = 1; set @@global.rpl_semi_sync_master_wait_point=AFTER_SYNC; --connection server_2 +--source include/kill_binlog_dump_threads.inc RESET MASTER; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; set @@session.gtid_domain_id=20; diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test index 23c8bdc3e2d..cec1fbb3bf4 100644 --- a/mysql-test/suite/rpl/t/rpl_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_colSize.test @@ -68,6 +68,7 @@ eval CREATE TABLE t1 ( t LONGTEXT ); +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo *** Start replication *** diff --git a/mysql-test/suite/rpl/t/rpl_delayed_slave.test b/mysql-test/suite/rpl/t/rpl_delayed_slave.test index 32d0b030eed..693b912face 100644 --- a/mysql-test/suite/rpl/t/rpl_delayed_slave.test +++ b/mysql-test/suite/rpl/t/rpl_delayed_slave.test @@ -384,6 +384,7 @@ CHANGE MASTER TO MASTER_DELAY = 71; --source include/reset_slave.inc --echo [on master] --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo [on slave] --connection slave diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test index 7e2daa9abc9..f4b54cfe439 100644 --- a/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test +++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test @@ -16,6 +16,7 @@ create table t1 ( connection master; create table t1 (a int primary key, b blob, c char(5)) engine=innodb; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index a7af234d47e..2f2669bda6d 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -180,6 +180,7 @@ SET @old_state= @@GLOBAL.gtid_binlog_state; --error ER_BINLOG_MUST_BE_EMPTY SET GLOBAL gtid_binlog_state = ''; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET GLOBAL gtid_binlog_state = ''; FLUSH LOGS; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index 05283139533..da3c7e31a0f 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -89,6 +89,7 @@ RESET MASTER; SET GLOBAL gtid_slave_pos=''; --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --replace_column 2 # 4 # 5 # SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test index 578f1e35213..f3008dcc83e 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test @@ -115,6 +115,7 @@ SET SESSION binlog_format= @old_mode; --source include/stop_slave.inc --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; # This insert will be GTID 0-1-1 INSERT INTO t1 VALUES (2); diff --git a/mysql-test/suite/rpl/t/rpl_gtid_header_valid.test b/mysql-test/suite/rpl/t/rpl_gtid_header_valid.test index d4d75ba8928..d0aa57f64f8 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_header_valid.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_header_valid.test @@ -63,6 +63,7 @@ STOP SLAVE IO_THREAD; --echo # Reset master binlogs (as there is an invalid event) and slave state --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave RESET MASTER; @@ -97,6 +98,7 @@ set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; --echo # Reset master binlogs (as there is an invalid event) and slave state --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave RESET MASTER; @@ -131,6 +133,7 @@ set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; --echo # Reset master binlogs (as there is an invalid event) and slave state --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave RESET MASTER; @@ -159,6 +162,7 @@ STOP SLAVE IO_THREAD; --echo # Reset master binlogs (as there is an invalid event) and slave state --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave @@ -188,6 +192,7 @@ STOP SLAVE IO_THREAD; --echo # Reset master binlogs (as there is an invalid event) and slave state --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test index 79b3b7d464a..db0e0d20793 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test @@ -25,6 +25,7 @@ SELECT * FROM t1 ORDER BY a; INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); --let $old_gtid_pos= `SELECT @@GLOBAL.gtid_current_pos` +--source include/kill_binlog_dump_threads.inc RESET MASTER; --replace_result $old_gtid_pos OLD_GTID_POS eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test index 1452d6b01f0..1d4d9c9e715 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test @@ -55,6 +55,7 @@ SET GLOBAL gtid_slave_pos= ""; --connection server_1 SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +--source include/kill_binlog_dump_threads.inc RESET MASTER; # A1 B1 A2 B2 A3 B3, slave reached A1 and B3 and stopped. Slave starts, @@ -101,6 +102,7 @@ SET GLOBAL gtid_slave_pos= ""; --connection server_1 SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +--source include/kill_binlog_dump_threads.inc RESET MASTER; # A1 B1 A2 B2 A3 B3. START SLAVE UNTIL A1,B3, gets reconnect at B2. @@ -154,6 +156,7 @@ SET GLOBAL gtid_slave_pos= ""; --connection server_1 SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --source include/kill_binlog_dump_threads.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_sort.test b/mysql-test/suite/rpl/t/rpl_gtid_sort.test index c31ba877bbf..99465e2ce85 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_sort.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_sort.test @@ -13,6 +13,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_binlog_state'; --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; FLUSH LOGS; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test index d0885ab8912..5e1fe67b9f6 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test @@ -9,6 +9,7 @@ RESET MASTER; RESET SLAVE; --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Create an empty binlog file, to check that empty binlog state is handled correctly. FLUSH LOGS; @@ -113,6 +114,7 @@ RESET SLAVE ALL; RESET MASTER; --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection server_2 @@ -250,6 +252,7 @@ RESET MASTER; SET GLOBAL gtid_slave_pos=""; --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; TRUNCATE TABLE t1; INSERT INTO t1 VALUES (10); # Will be GTID 0-1-2 @@ -299,6 +302,7 @@ eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, maste --connection server_1 DROP TABLE t1; +--source include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t1 (a INT PRIMARY KEY); diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test index c89cea23e93..1aee5fd5294 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_until.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test @@ -211,6 +211,7 @@ SET GLOBAL gtid_slave_pos=''; --connection server_1 # Do it once to compute the right GTID, then throw it away and do it again # for the actual test. +--source include/kill_binlog_dump_threads.inc RESET MASTER; INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (11); diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test index a34cf761c8a..6887c1bba1d 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test @@ -10,11 +10,14 @@ -- source include/have_log_bin.inc -- source include/master-slave.inc +connection slave; +-- source include/stop_slave.inc + connection master; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; --- source include/stop_slave.inc set @restore_slave_net_timeout= @@global.slave_net_timeout; --disable_warnings set @@global.slave_net_timeout= 10; diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index fb67ad770d5..2e0402bb092 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -35,6 +35,7 @@ eval SET @restore_slave_heartbeat_timeout=$slave_heartbeat_timeout; --enable_query_log --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET @restore_slave_net_timeout=@@global.slave_net_timeout; --echo @@ -415,6 +416,7 @@ DROP TABLE t1; set sql_log_bin= 1; --connection master DROP TABLE t1; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection slave --replace_result $MASTER_MYPORT MASTER_PORT @@ -465,10 +467,15 @@ STOP SLAVE; --source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; + +--connection master +--source include/kill_binlog_dump_threads.inc +RESET MASTER; + +--connection slave --source include/start_slave.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); --connection master -RESET MASTER; --enable_query_log --sync_slave_with_master --sleep 2 diff --git a/mysql-test/suite/rpl/t/rpl_mdev_17614.test b/mysql-test/suite/rpl/t/rpl_mdev_17614.test index e9a41c95ff0..ca27b8b64b9 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev_17614.test +++ b/mysql-test/suite/rpl/t/rpl_mdev_17614.test @@ -43,6 +43,7 @@ SELECT * FROM t1; --source include/stop_slave_io.inc --source include/reset_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; drop table t1; connection slave; @@ -161,6 +162,7 @@ SELECT * FROM t1; --source include/stop_slave_io.inc --source include/reset_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; drop table t1; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_mysqlbinlog_slave_consistency.test b/mysql-test/suite/rpl/t/rpl_mysqlbinlog_slave_consistency.test index d2918e3a890..4f95f5ee050 100644 --- a/mysql-test/suite/rpl/t/rpl_mysqlbinlog_slave_consistency.test +++ b/mysql-test/suite/rpl/t/rpl_mysqlbinlog_slave_consistency.test @@ -46,6 +46,7 @@ SET sql_log_bin=1; --source include/stop_slave.inc --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Save old state @@ -390,11 +391,13 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos, DO_DOMAIN_IDS=(0), IGNORE_DOMAIN_IDS RESET MASTER; set global gtid_slave_pos=""; CHANGE MASTER TO MASTER_USE_GTID=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(); ---source include/start_slave.inc # Cleanup --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; +--connection slave +--source include/start_slave.inc --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index f1814e61f9b..2a5d3e4b688 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -142,6 +142,7 @@ connection slave; STOP SLAVE; RESET SLAVE; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test index 0797e8bf220..23c5f4330d7 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test @@ -15,6 +15,7 @@ RESET MASTER; RESET SLAVE; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t1 (a int primary key, b text) ENGINE=InnoDB; --let $a0 = 25 diff --git a/mysql-test/suite/rpl/t/rpl_parallel_seq.test b/mysql-test/suite/rpl/t/rpl_parallel_seq.test index 9522a976b89..cc8fc36e3d4 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_seq.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_seq.test @@ -80,6 +80,7 @@ SET DEBUG_SYNC = 'now SIGNAL continue_worker'; RESET MASTER; SET @@global.gtid_slave_pos=""; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Load from master diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test index 794a0c631d7..a892efa37b9 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test @@ -206,11 +206,14 @@ EOF --connection master drop table t; -reset master; - --connection slave --let $rpl_only_running_threads= 1 --source include/stop_slave.inc +--connection master +--source include/kill_binlog_dump_threads.inc +reset master; + +--connection slave reset slave; reset master; set @@global.gtid_slave_pos= ""; diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test index 72559fc4090..de9313a8705 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test @@ -232,6 +232,7 @@ select Last_Error_Message from performance_schema.replication_applier_status_by_ RESET SLAVE; --connection master DROP TABLE t; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --echo diff --git a/mysql-test/suite/rpl/t/rpl_reset_master.test b/mysql-test/suite/rpl/t/rpl_reset_master.test new file mode 100644 index 00000000000..05f67cb3b3d --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_reset_master.test @@ -0,0 +1,53 @@ +--source include/have_debug_sync.inc +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +--connection master +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +FLUSH BINARY LOGS; +INSERT INTO t1 VALUES (2); + +--echo *** Test that RESET MASTER fails when a slave is connected. +--error ER_BINLOG_IN_USE +RESET MASTER; + +--connection master +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc + +--connection master +--echo *** Test that RESET MASTER fails on concurrent SHOW BINLOG EVENTS. +--source include/kill_binlog_dump_threads.inc + +--connection master1 +SET debug_sync= 'after_show_binlog_events SIGNAL waiting WAIT_FOR go'; +--disable_result_log +send SHOW BINLOG EVENTS in 'master-bin.000001'; + +--connection master +SET debug_sync= 'now WAIT_FOR waiting'; +--error ER_BINLOG_IN_USE +RESET MASTER; +SET debug_sync= 'now SIGNAL go'; + +--connection master1 +reap; +--enable_result_log + +--connection master +--echo *** RESET MASTER works when no concurrent reader. +RESET MASTER; + +DROP TABLE t1; +--source include/save_master_gtid.inc + +--connection slave +SET GLOBAL gtid_slave_pos= ''; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test index 887c0961a63..a31570f4273 100644 --- a/mysql-test/suite/rpl/t/rpl_row_001.test +++ b/mysql-test/suite/rpl/t/rpl_row_001.test @@ -10,10 +10,11 @@ # we'll use table-level locking to delay slave SQL thread eval CREATE TABLE t1 (n INT); sync_slave_with_master; +--source include/stop_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; -STOP SLAVE; --source include/reset_slave.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index 9e10aaa6216..cce433a9366 100644 --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -98,6 +98,7 @@ sync_slave_with_master; stop slave; --source include/wait_for_slave_to_stop.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; --source include/reset_slave.inc @@ -165,6 +166,7 @@ sync_slave_with_master; stop slave; --source include/wait_for_slave_to_stop.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; --source include/reset_slave.inc @@ -228,6 +230,7 @@ sync_slave_with_master; stop slave; --source include/wait_for_slave_to_stop.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; --source include/reset_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index 6f85ef95b79..fb86c1dfe0c 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -48,6 +48,7 @@ set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; +--source include/kill_binlog_dump_threads.inc reset master; set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -349,10 +350,12 @@ eval create table t1 (a int) engine = $engine_type; drop table t1; sync_slave_with_master; +source include/stop_slave.inc; echo [ test reset master ]; connection master; +--source include/kill_binlog_dump_threads.inc reset master; show status like 'Rpl_semi_sync_master_status'; @@ -361,7 +364,6 @@ show status like 'Rpl_semi_sync_master_yes_tx'; connection slave; -source include/stop_slave.inc; --source include/reset_slave.inc # Kill the dump thread on master for previous slave connection and @@ -404,6 +406,7 @@ connection slave; source include/stop_slave.inc; --source include/reset_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc reset master; # Kill the dump thread on master for previous slave connection and wait for it to exit diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test b/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test index e4d0bc0acd1..5add124bd7a 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test @@ -21,6 +21,7 @@ flush tables; # Initial master --connection server_1 +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET @@global.max_binlog_size= 4096; set @@global.rpl_semi_sync_master_enabled = 1; @@ -199,10 +200,12 @@ SHOW VARIABLES LIKE 'gtid_binlog_state'; set global rpl_semi_sync_slave_enabled = 0; set global rpl_semi_sync_master_enabled = 0; set global rpl_semi_sync_master_wait_point=default; +--source include/kill_binlog_dump_threads.inc RESET MASTER; RESET SLAVE; --connection server_2 +--source include/kill_binlog_dump_threads.inc RESET MASTER; RESET SLAVE; set @@global.rpl_semi_sync_master_enabled = 0; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test b/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test index 96f7e805fc5..eed83570aab 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test @@ -5,13 +5,15 @@ source include/master-slave.inc; # # Semisync initialization # +--connection slave +source include/stop_slave.inc; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled` SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; --connection slave -source include/stop_slave.inc; --let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled` SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1; source include/start_slave.inc; @@ -46,6 +48,7 @@ INSERT INTO t1 SET a = 3; --source include/stop_slave_io.inc --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; --eval SET @@global.gtid_binlog_state = '$resume_gtid' diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test index 6dc2f791954..e5df2d3a5b2 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -36,6 +36,7 @@ drop table t1; # in presense of --replicate-same-server-id the slave is started with. connection master; +--source include/kill_binlog_dump_threads.inc reset master; # setting the until position to correspond to the last position of diff --git a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test index 06cf12ab7a9..f506a980f7d 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test +++ b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test @@ -68,6 +68,7 @@ RESET REPLICA ALL; set @@global.gtid_slave_pos= ""; --connection master +--source include/kill_binlog_dump_threads.inc RESET MASTER; CREATE TABLE t(f INT) ENGINE=INNODB; INSERT INTO t VALUES (10); diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index 933e7d14f9b..445cd8f8a5d 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -57,6 +57,7 @@ STOP SLAVE; --source include/wait_for_slave_to_stop.inc --source include/reset_slave.inc connection master; +--source include/kill_binlog_dump_threads.inc RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_7.test b/mysql-test/suite/rpl/t/rpl_start_alter_7.test index 0e72b43e33f..8ce54c6bfb9 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_7.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_7.test @@ -105,10 +105,12 @@ SET GLOBAL gtid_slave_pos= ''; --connection server_1 --eval set global binlog_alter_two_phase=$binlog_alter_two_phase; set global gtid_domain_id= 0; +--source include/kill_binlog_dump_threads.inc reset master; --connection server_2 set global gtid_domain_id= 0; --eval set global binlog_alter_two_phase=$binlog_alter_two_phase +--source include/kill_binlog_dump_threads.inc reset master; --disconnect server_1 diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_8.test b/mysql-test/suite/rpl/t/rpl_start_alter_8.test index ac7abca255e..17d46ebdb35 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_8.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_8.test @@ -102,10 +102,12 @@ SET GLOBAL gtid_slave_pos= ''; --connection server_1 --eval set global binlog_alter_two_phase=$binlog_alter_two_phase; set global gtid_domain_id= 0; +--source include/kill_binlog_dump_threads.inc reset master; --connection server_2 set global gtid_domain_id= 0; --eval set global binlog_alter_two_phase=$binlog_alter_two_phase; +--source include/kill_binlog_dump_threads.inc reset master; --disconnect server_1 diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test index a2f6adcc554..52552cdbcb1 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test @@ -26,6 +26,7 @@ set global gtid_strict_mode=1; --let $MYSQLD_DATADIR= `select @@datadir;` --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql select @@gtid_binlog_state; +--source include/kill_binlog_dump_threads.inc RESET master; --connection slave diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test index 1cbc5b67fb9..2de8c557e39 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test @@ -157,10 +157,12 @@ SET GLOBAL gtid_slave_pos= ''; --connection server_1 SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase; SET GLOBAL gtid_domain_id= 0; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --connection server_2 SET GLOBAL gtid_domain_id= 0; SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase; +--source include/kill_binlog_dump_threads.inc RESET MASTER; --disconnect server_1 diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test index 3851e61868b..6d1bb047e49 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -49,10 +49,11 @@ connection master; # we'll use table-level locking to delay slave SQL thread eval create table t1 (n int); sync_slave_with_master; +stop slave; connection master; +--source include/kill_binlog_dump_threads.inc reset master; connection slave; -stop slave; --source include/reset_slave.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index ebfd355b299..bd43d2cab2a 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -136,6 +136,7 @@ connection master; --disable_warnings drop table if exists t1; --enable_warnings +--source include/kill_binlog_dump_threads.inc reset master; create table t1 (a int primary key auto_increment); save_master_pos; diff --git a/mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test b/mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test index 70103acf862..dbe08764478 100644 --- a/mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test +++ b/mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test @@ -38,12 +38,18 @@ --echo # --echo # Initialize system-versioned and partitioned table and its data +--connection slave +--source include/stop_slave.inc --connection master # Fix the timestamp for the system versioned row_start and row_end fields, so # the later hard-coded BINLOG base64 data can find the rows. SET timestamp=UNIX_TIMESTAMP('2025-01-01 01:00:00.000000'); +--source include/kill_binlog_dump_threads.inc RESET MASTER; +--connection slave +--source include/start_slave.inc +--connection master create table t1 (x int) engine=InnoDB with system versioning partition by system_time limit 3 partitions 5; insert into t1 values(1); diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test index 4b5778ca245..eaa062c5954 100644 --- a/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-test/suite/rpl/t/rpl_timezone.test @@ -179,6 +179,7 @@ SET @@session.time_zone = default; # Insert 2 values into timestamp col with different time_zone. Check result. --connection master +--source include/kill_binlog_dump_threads.inc reset master; CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL); diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index e442ed94d5a..1a14d790b05 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -378,6 +378,7 @@ SHOW TABLES LIKE 't_'; --replace_column 6 # SHOW TRIGGERS; +--source include/kill_binlog_dump_threads.inc RESET MASTER; # Restart slave. diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test index ce01e41f8dc..17264d0a3d6 100644 --- a/mysql-test/suite/rpl/t/semisync_future-7591.test +++ b/mysql-test/suite/rpl/t/semisync_future-7591.test @@ -16,6 +16,7 @@ start slave; --connection master insert into t1 values (1); +--source include/kill_binlog_dump_threads.inc reset master; --connection slave diff --git a/mysql-test/suite/s3/replication_delayed.result b/mysql-test/suite/s3/replication_delayed.result index 706fcfe6d7e..a5714d2ce5e 100644 --- a/mysql-test/suite/s3/replication_delayed.result +++ b/mysql-test/suite/s3/replication_delayed.result @@ -1,8 +1,13 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +connection master; set binlog_format=mixed; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +include/start_slave.inc set binlog_format=mixed; RESET MASTER; connection master; diff --git a/mysql-test/suite/s3/replication_delayed.test b/mysql-test/suite/s3/replication_delayed.test index 0ae93b850c4..431e11fde9c 100644 --- a/mysql-test/suite/s3/replication_delayed.test +++ b/mysql-test/suite/s3/replication_delayed.test @@ -5,9 +5,14 @@ --source include/have_sequence.inc # First clear the binlog +connection slave; +--source include/stop_slave.inc +connection master; set binlog_format=mixed; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +--source include/start_slave.inc set binlog_format=mixed; RESET MASTER; connection master; diff --git a/mysql-test/suite/s3/replication_mixed.result b/mysql-test/suite/s3/replication_mixed.result index 80a32b28d8a..37fafafb4b9 100644 --- a/mysql-test/suite/s3/replication_mixed.result +++ b/mysql-test/suite/s3/replication_mixed.result @@ -1,8 +1,13 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +connection master; set binlog_format=mixed; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +include/start_slave.inc set binlog_format=mixed; RESET MASTER; connection master; diff --git a/mysql-test/suite/s3/replication_mixed.test b/mysql-test/suite/s3/replication_mixed.test index d10d586dab9..5fbdc21e442 100644 --- a/mysql-test/suite/s3/replication_mixed.test +++ b/mysql-test/suite/s3/replication_mixed.test @@ -1,9 +1,14 @@ --source include/have_binlog_format_mixed.inc --source include/master-slave.inc +connection slave; +--source include/stop_slave.inc +connection master; set binlog_format=mixed; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +--source include/start_slave.inc set binlog_format=mixed; RESET MASTER; connection master; diff --git a/mysql-test/suite/s3/replication_stmt.result b/mysql-test/suite/s3/replication_stmt.result index 4257823bbea..4f27b7ce474 100644 --- a/mysql-test/suite/s3/replication_stmt.result +++ b/mysql-test/suite/s3/replication_stmt.result @@ -1,8 +1,13 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +connection master; set binlog_format=statement; +include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +include/start_slave.inc set binlog_format=statement; RESET MASTER; connection master; diff --git a/mysql-test/suite/s3/replication_stmt.test b/mysql-test/suite/s3/replication_stmt.test index aba5d155e6c..84e09717134 100644 --- a/mysql-test/suite/s3/replication_stmt.test +++ b/mysql-test/suite/s3/replication_stmt.test @@ -1,9 +1,14 @@ --source include/have_binlog_format_statement.inc --source include/master-slave.inc +connection slave; +--source include/stop_slave.inc +connection master; set binlog_format=statement; +--source include/kill_binlog_dump_threads.inc RESET MASTER; connection slave; +--source include/start_slave.inc set binlog_format=statement; RESET MASTER; connection master; diff --git a/sql/handler.cc b/sql/handler.cc index 1e7653546b2..d9672c0aef8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -8354,8 +8354,6 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) if (!WSREP(bf_thd) && !(bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU && wsrep_thd_is_toi(bf_thd))) { - mysql_mutex_unlock(&victim_thd->LOCK_thd_data); - mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); DBUG_RETURN(0); } @@ -8367,8 +8365,6 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) else { WSREP_WARN("Cannot abort InnoDB transaction"); - mysql_mutex_unlock(&victim_thd->LOCK_thd_data); - mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); } DBUG_RETURN(0); diff --git a/sql/log.cc b/sql/log.cc index 1a5a74d64da..479d6cb58dd 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3703,12 +3703,14 @@ void MYSQL_BIN_LOG::cleanup() mysql_mutex_destroy(&LOCK_log); mysql_mutex_destroy(&LOCK_index); + mysql_mutex_destroy(&LOCK_binlog_use); mysql_mutex_destroy(&LOCK_xid_list); mysql_mutex_destroy(&LOCK_binlog_background_thread); mysql_mutex_destroy(&LOCK_binlog_end_pos); mysql_cond_destroy(&COND_relay_log_updated); mysql_cond_destroy(&COND_bin_log_updated); mysql_cond_destroy(&COND_queue_busy); + mysql_cond_destroy(&COND_binlog_use); mysql_cond_destroy(&COND_xid_list); mysql_cond_destroy(&COND_binlog_background_thread); mysql_cond_destroy(&COND_binlog_background_thread_end); @@ -3730,11 +3732,14 @@ void MYSQL_BIN_LOG::init_pthread_objects() Event_log::init_pthread_objects(); mysql_mutex_init(m_key_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); mysql_mutex_setflags(&LOCK_index, MYF_NO_DEADLOCK_DETECTION); + mysql_mutex_init(key_BINLOG_LOCK_binlog_use, &LOCK_binlog_use, + MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_BINLOG_LOCK_xid_list, &LOCK_xid_list, MY_MUTEX_INIT_FAST); mysql_cond_init(m_key_relay_log_update, &COND_relay_log_updated, 0); mysql_cond_init(m_key_bin_log_update, &COND_bin_log_updated, 0); mysql_cond_init(m_key_COND_queue_busy, &COND_queue_busy, 0); + mysql_cond_init(key_BINLOG_COND_binlog_use, &COND_binlog_use, 0); mysql_cond_init(key_BINLOG_COND_xid_list, &COND_xid_list, 0); mysql_mutex_init(key_BINLOG_LOCK_binlog_background_thread, @@ -4539,6 +4544,67 @@ err: } +/* + Start reading the binlog, eg. a slave dump thread. + Wait for any already running RESET MASTER to complete. + Then increment the binlog use count. + Must be paired with a call to end_use_binlog() when use of the binlog is + complete by the reader, unless start_use_binlog() returns true/error. + + Returns: + false Successfully marked binlog in use. + true Error (wait was terminated by kill). +*/ +bool +MYSQL_BIN_LOG::start_use_binlog(THD *thd) +{ + PSI_stage_info old_stage; + bool killed_err= false; + + if (unlikely(is_relay_log)) + { + DBUG_ASSERT(FALSE); + return false; + } + + mysql_mutex_lock(&LOCK_binlog_use); + thd->ENTER_COND(&COND_binlog_use, &LOCK_binlog_use, + &stage_waiting_for_reset_master, &old_stage); + while (binlog_use_count < 0 && !thd->check_killed(1)) + mysql_cond_wait(&COND_binlog_use, &LOCK_binlog_use); + if (binlog_use_count < 0) + killed_err= true; + else + ++binlog_use_count; + thd->EXIT_COND(&old_stage); + + return killed_err; +} + + +/* + Stop reading the binlog, eg. a slave dump thread. + Must be called after a successful start_use_binlog(), once the use of the + binlog has completed. +*/ +void +MYSQL_BIN_LOG::end_use_binlog(THD *thd) +{ + if (unlikely(is_relay_log)) + { + DBUG_ASSERT(FALSE); + return; + } + + mysql_mutex_lock(&LOCK_binlog_use); + if (likely(binlog_use_count > 0)) + --binlog_use_count; + else + DBUG_ASSERT(FALSE); + mysql_mutex_unlock(&LOCK_binlog_use); +} + + /** Delete all logs referred to in the index file. @@ -4576,15 +4642,33 @@ bool MYSQL_BIN_LOG::reset_logs(THD *thd, bool create_new_log, DBUG_RETURN(1); } + /* + Give an error if any slave dump threads are running, and prevent any + new binlog readers (or another RESET MASTER) from running concurrently. + */ + mysql_mutex_lock(&LOCK_binlog_use); + if (binlog_use_count) + { + my_error(ER_BINLOG_IN_USE, MYF(0)); + mysql_mutex_unlock(&LOCK_binlog_use); + DBUG_RETURN(1); + } + binlog_use_count= -1; + mysql_mutex_unlock(&LOCK_binlog_use); + if (opt_binlog_engine_hton) { if (next_log_number) { my_error(ER_ENGINE_BINLOG_NO_RESET_FILE_NUMBER, MYF(0)); - DBUG_RETURN(true); + error= true; } - DBUG_ASSERT(create_new_log); - DBUG_RETURN(reset_engine_binlogs(thd, init_state, init_state_len)); + else + { + DBUG_ASSERT(create_new_log); + error= reset_engine_binlogs(thd, init_state, init_state_len); + } + goto exit_engine_binlog; } /* @@ -4845,6 +4929,17 @@ err: mysql_mutex_unlock(&LOCK_index); mysql_mutex_unlock(&LOCK_log); + + if (!is_relay_log) + { +exit_engine_binlog: + mysql_mutex_lock(&LOCK_binlog_use); + DBUG_ASSERT(binlog_use_count == -1); + binlog_use_count= 0; + mysql_cond_signal(&COND_binlog_use); + mysql_mutex_unlock(&LOCK_binlog_use); + } + DBUG_RETURN(error); } diff --git a/sql/log.h b/sql/log.h index ba45da38254..b0aecd06245 100644 --- a/sql/log.h +++ b/sql/log.h @@ -679,6 +679,18 @@ class MYSQL_BIN_LOG: public TC_LOG, private Event_log uint reset_master_pending; ulong mark_xid_done_waiting; + /* + Protect against binlog readers (eg. slave dump threads) running + concurrently with RESET MASTER. + binlog_use_count counts the number of active readers, or is -1 when a + RESET MASTER is running. It is protected by LOCK_binlog_use and + COND_binlog_use is signalled when RESET MASTER completes so new + readers can wait for that. + */ + int32_t binlog_use_count; + mysql_mutex_t LOCK_binlog_use; + mysql_cond_t COND_binlog_use; + /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ mysql_mutex_t LOCK_index; mysql_mutex_t LOCK_xid_list; @@ -1105,6 +1117,8 @@ public: int register_create_index_entry(const char* entry); int purge_index_entry(THD *thd, ulonglong *decrease_log_space, bool need_mutex); + bool start_use_binlog(THD *thd); + void end_use_binlog(THD *thd); bool reset_logs(THD* thd, bool create_new_log, rpl_gtid *init_state, uint32 init_state_len, ulong next_log_number); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ceea85b6ccd..887120927e3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -937,7 +937,8 @@ PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, key_LOCK_pool, key_LOCK_pending_checkpoint; #endif /* HAVE_MMAP */ -PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list, +PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_binlog_use, + key_BINLOG_LOCK_xid_list, key_BINLOG_LOCK_binlog_background_thread, key_LOCK_binlog_end_pos, key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, @@ -1000,6 +1001,7 @@ static PSI_mutex_info all_server_mutexes[]= #endif /* HAVE_des */ { &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0}, + { &key_BINLOG_LOCK_binlog_use, "MYSQL_BIN_LOG::LOCK_binlog_use", 0}, { &key_BINLOG_LOCK_xid_list, "MYSQL_BIN_LOG::LOCK_xid_list", 0}, { &key_BINLOG_LOCK_binlog_background_thread, "MYSQL_BIN_LOG::LOCK_binlog_background_thread", 0}, { &key_LOCK_binlog_end_pos, "MYSQL_BIN_LOG::LOCK_binlog_end_pos", 0 }, @@ -1102,7 +1104,7 @@ static PSI_rwlock_info all_server_rwlocks[]= PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; #endif /* HAVE_MMAP */ -PSI_cond_key key_BINLOG_COND_xid_list, +PSI_cond_key key_BINLOG_COND_binlog_use, key_BINLOG_COND_xid_list, key_BINLOG_COND_bin_log_updated, key_BINLOG_COND_relay_log_updated, key_BINLOG_COND_binlog_background_thread, key_BINLOG_COND_binlog_background_thread_end, @@ -1139,6 +1141,7 @@ static PSI_cond_info all_server_conds[]= { &key_TC_LOG_MMAP_COND_queue_busy, "TC_LOG_MMAP::COND_queue_busy", 0}, #endif /* HAVE_MMAP */ { &key_BINLOG_COND_bin_log_updated, "MYSQL_BIN_LOG::COND_bin_log_updated", 0}, { &key_BINLOG_COND_relay_log_updated, "MYSQL_BIN_LOG::COND_relay_log_updated", 0}, + { &key_BINLOG_COND_binlog_use, "MYSQL_BIN_LOG::COND_binlog_use", 0}, { &key_BINLOG_COND_xid_list, "MYSQL_BIN_LOG::COND_xid_list", 0}, { &key_BINLOG_COND_binlog_background_thread, "MYSQL_BIN_LOG::COND_binlog_background_thread", 0}, { &key_BINLOG_COND_binlog_background_thread_end, "MYSQL_BIN_LOG::COND_binlog_background_thread_end", 0}, @@ -9582,6 +9585,7 @@ PSI_stage_info stage_waiting_for_deadlock_kill= { 0, "Waiting for parallel repli PSI_stage_info stage_starting= { 0, "starting", 0}; PSI_stage_info stage_waiting_for_flush= { 0, "Waiting for non trans tables to be flushed", 0}; PSI_stage_info stage_waiting_for_ddl= { 0, "Waiting for DDLs", 0}; +PSI_stage_info stage_waiting_for_reset_master= { 0, "Waiting for a running RESET MASTER to complete", 0}; #ifdef WITH_WSREP // Aditional Galera thread states @@ -9811,7 +9815,8 @@ PSI_stage_info *all_server_stages[]= & stage_waiting_for_semi_sync_slave, & stage_reading_semi_sync_ack, & stage_waiting_for_deadlock_kill, - & stage_starting + & stage_starting, + & stage_waiting_for_reset_master #ifdef WITH_WSREP , & stage_waiting_isolation, diff --git a/sql/mysqld.h b/sql/mysqld.h index 060cf3a77c9..896e8c7cc1d 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -330,7 +330,8 @@ extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, key_LOCK_pool, key_LOCK_pending_checkpoint; #endif /* HAVE_MMAP */ -extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list, +extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_binlog_use, + key_BINLOG_LOCK_xid_list, key_BINLOG_LOCK_binlog_background_thread, key_LOCK_binlog_end_pos, key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, @@ -377,7 +378,8 @@ extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; #endif /* HAVE_MMAP */ -extern PSI_cond_key key_BINLOG_COND_xid_list, key_BINLOG_update_cond, +extern PSI_cond_key key_BINLOG_COND_binlog_use, + key_BINLOG_COND_xid_list, key_BINLOG_update_cond, key_BINLOG_COND_binlog_background_thread, key_BINLOG_COND_binlog_background_thread_end, key_COND_cache_status_changed, key_COND_manager, @@ -707,6 +709,7 @@ extern PSI_stage_info stage_slave_background_process_request; extern PSI_stage_info stage_slave_background_wait_request; extern PSI_stage_info stage_waiting_for_deadlock_kill; extern PSI_stage_info stage_starting; +extern PSI_stage_info stage_waiting_for_reset_master; #ifdef WITH_WSREP // Aditional Galera thread states extern PSI_stage_info stage_waiting_isolation; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 40980341c7c..dd86155abd3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4090,7 +4090,13 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt) WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (check_global_access(thd, PRIV_STMT_SHOW_BINLOG_EVENTS)) goto error; + if (mysql_bin_log.start_use_binlog(thd)) + { + my_error(thd->killed_errno(), MYF(0)); + goto error; + } res = mysql_show_binlog_events(thd); + mysql_bin_log.end_use_binlog(thd); break; } #endif diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index c3cd3750556..bcf21906596 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -3486,6 +3486,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, binlog_send_info infoobj(thd, packet, flags, linfo.log_file_name); binlog_send_info *info= &infoobj; bool has_transmit_started= false; + bool start_use_binlog= false; int old_max_allowed_packet= thd->variables.max_allowed_packet; thd->variables.max_allowed_packet= MAX_MAX_ALLOWED_PACKET; @@ -3495,6 +3496,14 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, bzero((char*) &log,sizeof(log)); + if (mysql_bin_log.start_use_binlog(thd)) + { + info->errmsg= "Binlog dump terminated by user kill"; + info->error= ER_CONNECTION_KILLED; + goto err; + } + start_use_binlog= true; + if (init_binlog_sender(info, &linfo, log_ident, &pos)) goto err; @@ -3717,6 +3726,9 @@ err: thd->variables.max_allowed_packet= old_max_allowed_packet; delete info->fdev; + if (start_use_binlog) + mysql_bin_log.end_use_binlog(thd); + if (likely(info->error == 0)) { my_eof(thd); diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 8e83aa95538..41b9c49255f 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -465,8 +465,6 @@ uint wsrep_kill_thd(THD *thd, THD *victim_thd, killed_state kill_signal) DEBUG_SYNC(thd, "wsrep_kill_before_awake_no_mutex"); victim_thd->wsrep_abort_by_kill= kill_signal; victim_thd->awake_no_mutex(kill_signal); - /* ha_abort_transaction() releases tmp->LOCK_thd_kill, so tmp - is not safe to access anymore. */ ha_abort_transaction(thd, victim_thd, 1); DBUG_RETURN(0); }