Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_stop_on_rotate.test

raw
1 # ==== Purpose ====
2 #
3 # This test checks that when stopped at the exact moment during the auto
4 # position protocol where rotate events are being exchanged and the group
5 # master log position goes for a moment back to 4, this does not affect
6 # posterior replica start operations.
7 #
8 # ==== Requirements ====
9 #
10 # R1: The process of MTA recovery should not fail even if the replica is
11 # stopped in the middle of the auto positioning protocol.
12 #
13 # ==== Implementation ====
14 #
15 # 1. Add some data to be applied in the replica
16 # 2. Add a debug point so the replica stops at the first sent rotate
17 # Stop the replica IO thread so the auto positioning protocol runs
18 # 3. Stop the replica ensuring it stops on the first replica
19 # sent rotate that has 4 as the position
20 # 4. Start the replica again and check all is good
21 #
22 # ==== References ====
23 #
24 # Bug#30571587 MYSQL 8.0.18 FAILS ON STOP SLAVE/START SLAVE STRESS TEST
25 #
26
27 --source include/have_debug_sync.inc
28 --source include/only_mts_replica_parallel_workers.inc
29 --source include/have_binlog_format_row.inc
30 --source include/master-slave.inc
31
32 --echo
33 --echo ############################################################
34 --echo # 1. Add some data to be applied in the replica
35
36 # Some data for worker execution
37 CREATE TABLE t1 (a INT PRIMARY KEY);
38 INSERT INTO t1 VALUES(1);
39
40 --source include/sync_slave_sql_with_master.inc
41
42 --echo
43 --echo ############################################################
44 --echo # 2. Add a debug point so the replica stops at the first sent rotate
45 --echo # Stop the replica IO thread so the auto positioning protocol runs
46
47 --source include/stop_slave_io.inc
48
49 --let $debug_point=block_on_master_pos_4_rotate
50 --source include/add_debug_point.inc
51
52 --let $debug_point=block_on_thread_stop_after_awake
53 --source include/add_debug_point.inc
54
55 --source include/start_slave_io.inc
56
57 --echo
58 --echo ############################################################
59 --echo # 3. Stop the replica ensuring it stops on the first replica
60 --echo # sent rotate that has 4 as the position
61
62 SET DEBUG_SYNC= "now WAIT_FOR signal.reach_pos_4_rotate_event";
63
64 --send STOP REPLICA
65
66 --let $rpl_connection_name= server_2
67 --source include/rpl_connection.inc
68
69 # Wait on for the point where we already signaled the SQL thread to stop
70 # This wait also prevents concurrency scenarios between the debug point setting
71 # a thread stage, the SQL thread setting another stage while waiting for
72 # workers to finish and the stop process issuing a awake request in the middle
73 SET DEBUG_SYNC= "now WAIT_FOR signal.stop_point_after_awake";
74
75 # Let the thread stop
76 SET DEBUG_SYNC= "now SIGNAL signal.rotate_event_continue";
77
78 --source include/rpl_connection_slave.inc
79
80 --reap
81
82 --echo
83 --echo ############################################################
84 --echo # 4. Start the replica again and check all is good
85
86 --let $debug_point=block_on_master_pos_4_rotate
87 --source include/remove_debug_point.inc
88
89 --let $debug_point=block_on_thread_stop_after_awake
90 --source include/remove_debug_point.inc
91
92 SET DEBUG_SYNC= "RESET";
93
94 --source include/start_slave.inc
95
96 --source include/rpl_connection_master.inc
97
98 INSERT INTO t1 VALUES(2);
99
100 DROP TABLE t1;
101
102 --source include/sync_slave_sql_with_master.inc
103
104 --source include/rpl_end.inc