Commit 3b724a05 authored by unknown's avatar unknown

Attempt to fix rpl.rpl_corruption failure seen in Buildbot on Windows.

There is a potential race when we stop the slave. It may take some time for
the master to detect that the slave connection is closed (eg. if scheduling
delays the TCP RSET packet or whatever). Since we inject only a single corrupt
binlog event, we may be unfortunate enough to inject it on the wrong
connection, to a slave io thread that's already stopped.

Fix by waiting for the old dump thread on the master to go away before
injecting the corrupt event.
parent 3622983a
...@@ -79,6 +79,16 @@ SET GLOBAL debug="-d,corrupt_read_log_event_char"; ...@@ -79,6 +79,16 @@ SET GLOBAL debug="-d,corrupt_read_log_event_char";
# Emulate corruption on master with crc checking on master # Emulate corruption on master with crc checking on master
--echo # 3. Master read a corrupted event from binlog and send the error to slave --echo # 3. Master read a corrupted event from binlog and send the error to slave
# We have a rare but nasty potential race here: if the dump thread on
# the master for the _old_ slave connection has not yet discovered
# that the slave has disconnected, we will inject the corrupt event on
# the wrong connection, and the test will fail
# (+d,corrupt_read_log_event2 corrupts only one event).
let $wait_condition=
SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
--source include/wait_condition.inc
SET GLOBAL debug="+d,corrupt_read_log_event2"; SET GLOBAL debug="+d,corrupt_read_log_event2";
--connection slave --connection slave
START SLAVE IO_THREAD; START SLAVE IO_THREAD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment