# ==== Purpose ==== # # This test checks that when stopped at the exact moment during the auto # position protocol where rotate events are being exchanged and the group # master log position goes for a moment back to 4, this does not affect # posterior replica start operations. # # ==== Requirements ==== # # R1: The process of MTA recovery should not fail even if the replica is # stopped in the middle of the auto positioning protocol. # # ==== Implementation ==== # # 1. Add some data to be applied in the replica # 2. Add a debug point so the replica stops at the first sent rotate # Stop the replica IO thread so the auto positioning protocol runs # 3. Stop the replica ensuring it stops on the first replica # sent rotate that has 4 as the position # 4. Start the replica again and check all is good # # ==== References ==== # # Bug#30571587 MYSQL 8.0.18 FAILS ON STOP SLAVE/START SLAVE STRESS TEST # --source include/have_debug_sync.inc --source include/only_mts_replica_parallel_workers.inc --source include/have_binlog_format_row.inc --source include/master-slave.inc --echo --echo ############################################################ --echo # 1. Add some data to be applied in the replica # Some data for worker execution CREATE TABLE t1 (a INT PRIMARY KEY); INSERT INTO t1 VALUES(1); --source include/sync_slave_sql_with_master.inc --echo --echo ############################################################ --echo # 2. Add a debug point so the replica stops at the first sent rotate --echo # Stop the replica IO thread so the auto positioning protocol runs --source include/stop_slave_io.inc --let $debug_point=block_on_master_pos_4_rotate --source include/add_debug_point.inc --let $debug_point=block_on_thread_stop_after_awake --source include/add_debug_point.inc --source include/start_slave_io.inc --echo --echo ############################################################ --echo # 3. Stop the replica ensuring it stops on the first replica --echo # sent rotate that has 4 as the position SET DEBUG_SYNC= "now WAIT_FOR signal.reach_pos_4_rotate_event"; --send STOP REPLICA --let $rpl_connection_name= server_2 --source include/rpl_connection.inc # Wait on for the point where we already signaled the SQL thread to stop # This wait also prevents concurrency scenarios between the debug point setting # a thread stage, the SQL thread setting another stage while waiting for # workers to finish and the stop process issuing a awake request in the middle SET DEBUG_SYNC= "now WAIT_FOR signal.stop_point_after_awake"; # Let the thread stop SET DEBUG_SYNC= "now SIGNAL signal.rotate_event_continue"; --source include/rpl_connection_slave.inc --reap --echo --echo ############################################################ --echo # 4. Start the replica again and check all is good --let $debug_point=block_on_master_pos_4_rotate --source include/remove_debug_point.inc --let $debug_point=block_on_thread_stop_after_awake --source include/remove_debug_point.inc SET DEBUG_SYNC= "RESET"; --source include/start_slave.inc --source include/rpl_connection_master.inc INSERT INTO t1 VALUES(2); DROP TABLE t1; --source include/sync_slave_sql_with_master.inc --source include/rpl_end.inc