From da9ffca908a0e61935409cf2166ad8bd985765bb Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 24 Nov 2023 07:38:16 +0100 Subject: [PATCH] MDEV-29816 rpl.rpl_parallel_29322 occasionally fails in BB 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 --- mysql-test/suite/rpl/include/rpl_parallel_29322.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mysql-test/suite/rpl/include/rpl_parallel_29322.inc b/mysql-test/suite/rpl/include/rpl_parallel_29322.inc index 54eb13d7f09..b32d463294a 100644 --- a/mysql-test/suite/rpl/include/rpl_parallel_29322.inc +++ b/mysql-test/suite/rpl/include/rpl_parallel_29322.inc @@ -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