Description:
In the master-slave replication mode, if the binlog used by the sender process on the master behind the current latest binlog, the binlog requested by the sender process may be deleted when purge to the latest binlog is executed, resulting in an abnormal replication
How to repeat:
--source include/have_debug_sync.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
connect(master2,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect(master3,127.0.0.1,root,,test,$MASTER_MYPORT,);
--connection master
SET @save_debug=@@global.debug;
SET GLOBAL DEBUG='+d,before_dump_thread_acquires_current_mutex';
--let $iter=1
while ($iter)
{
FLUSH LOGS;
--connection slave
--source include/stop_slave.inc
--source include/start_slave.inc
--query_vertical show slave status
# Thread 1
--connection master
flush binary logs;
--echo "Wait_for dump_thread_signal"
SET DEBUG_SYNC='now WAIT_FOR dump_thread_signal';
# Thread 2
--connection master2
SET DEBUG_SYNC='purge_logs_after_lock_index_before_thread_count SIGNAL parked2 WAIT_FOR go_parked2';
--send PURGE BINARY LOGS BEFORE '2038-01-19'
--connection master
echo "Wait_for parked2";
SET DEBUG_SYNC='now WAIT_FOR parked2';
echo "now signal go to all 2 waiting threads";
SET DEBUG_SYNC='now SIGNAL go_dump_thread';
SET DEBUG_SYNC='now SIGNAL go_parked2';
--connection master2
--reap
--dec $iter
}
--echo "Cleanup"
--disconnect master2
--disconnect master3
--connection master
SET DEBUG_SYNC='RESET';
SET GLOBAL DEBUG=@save_debug;
source include/rpl_end.inc;