Skip to content

Commit 01ca57e

Browse files
committed
MDEV-32168: Postpush fix for rpl_domain_id_filter_master_crash
While a replica may be reading events from the primary, the primary is killed. Left to its own devices, the IO thread may or may not stop in error, depending on what it is doing when its connection to the primary is killed (e.g. a failed read results in an error, whereas if the IO thread is idly waiting for events when the connection dies, it will enter into a reconnect loop and reconnect). MDEV-32168 changed the test to always wait for the reconnect, thus breaking the error case, as the IO thread would be stopped at a time of expecting it to be running. The fix is to manually stop/start the IO thread to ensure it is in a consistent state. Note that rpl_domain_id_filter_master_crash.test will need additional changes after fixing MDEV-33268 Reviewed By: ============ Kristian Nielsen <knielsen@knielsen-hq.org>
1 parent 3cd8875 commit 01ca57e

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ connection master;
3838
include/rpl_start_server.inc [server_number=1]
3939
# Master has restarted successfully
4040
connection slave;
41-
include/wait_for_slave_io_to_start.inc
42-
include/wait_for_slave_sql_to_start.inc
41+
include/stop_slave_sql.inc
42+
include/stop_slave_io.inc
43+
include/start_slave.inc
4344
select * from ti;
4445
a
4546
1

mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,26 @@ connection master;
6767
save_master_pos;
6868

6969
--connection slave
70+
71+
# Left to its own devices, the IO thread may or may not stop in error,
72+
# depending on what it is doing when its connection to the primary is killed
73+
# (e.g. a failed read results in an error, whereas if the IO thread is idly
74+
# waiting for events when the connection dies, it will enter into a reconnect
75+
# loop and reconnect). So we manually stop/start the IO thread to ensure it is
76+
# in a consistent state
77+
#
78+
# FIXME: We shouldn't need to stop/start the SQL thread here, but due to
79+
# MDEV-33268, we have to. So after fixing 33268, this should only stop/start
80+
# the IO thread. Note the SQL thread must be stopped first due to an invalid
81+
# DBUG_ASSERT in the IO thread's stop logic that depends on the state of the
82+
# SQL thread (also reported and to be fixed in the same ticket).
83+
#
84+
--source include/stop_slave_sql.inc
7085
--let rpl_allow_error=1
71-
--source include/wait_for_slave_io_to_start.inc
86+
--source include/stop_slave_io.inc
7287
--let rpl_allow_error=
73-
--source include/wait_for_slave_sql_to_start.inc
88+
--source include/start_slave.inc
89+
7490
sync_with_master;
7591
select * from ti;
7692
select * from tm;

0 commit comments

Comments
 (0)