Skip to content

Commit

Permalink
MDEV-29816 rpl.rpl_parallel_29322 occasionally fails in BB
Browse files Browse the repository at this point in the history
Make sure the old binlog dump thread is not still running when manipulating
binlog files; otherwise there is a small chance it will see an invalid
partial file and report an I/O error.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
  • Loading branch information
knielsen committed Dec 11, 2023
1 parent 1e80601 commit da9ffca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mysql-test/suite/rpl/include/rpl_parallel_29322.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ if ($same_version_binlogs)

if (!$same_version_binlogs)
{
# Make sure the dump thread is gone before moving around binlog files. Else
# it might see an empty file and give error (MDEV-29816).
--let $dump_thrid= `Select id FROM information_schema.processlist WHERE Command='Binlog Dump'`
if ($dump_thrid) {
--disable_query_log
--error 0,ER_NO_SUCH_THREAD
eval KILL CONNECTION $dump_thrid;
--enable_query_log
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE Command='Binlog Dump'
--source include/wait_condition.inc
}
--move_file $datadir/master-bin.000002 $datadir/master-bin.000002.sav
--copy_file $MYSQL_TEST_DIR/std_data/mdev29078-mysql-bin.000001 $datadir/master-bin.000002
--exec $MYSQL_BINLOG --short-form $datadir/master-bin.000002
Expand Down

0 comments on commit da9ffca

Please sign in to comment.