From b2e312b0558cd9af6d8426412a3827e4e264b7b0 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 8 Aug 2023 16:10:31 +0200 Subject: [PATCH] MDEV-23021: rpl.rpl_parallel_optimistic_until fails in Buildbot The test case accessed slave-relay-bin.000003 without waiting for the IO thread to write it first. If the IO thread was slow, this could fail. Signed-off-by: Kristian Nielsen --- .../rpl/t/rpl_parallel_optimistic_until.test | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test index 508213c9075..0797e8bf220 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_until.test @@ -263,13 +263,34 @@ BEGIN; START SLAVE IO_THREAD; --source include/wait_for_slave_io_to_start.inc -# The following test sets the stop coordinate is set to inside the first event +# The following test sets the stop coordinate to inside the first event # of a relay log that holds events of a transaction started in an earlier log. # Peek the stop position in the middle of trx1, not even on a event boundary. --let $pos_until=255 --let $file_rl=slave-relay-bin.000003 --let $binlog_file=$file_rl +# Wait for the IO thread to write the trx1 to the relaylog before querying it. +# (wait_for_slave_param.inc isn't flexible enough, so do it manually.) +--let $continue= 1 +--let $count=600 +while ($continue) +{ + --let $cur_file= query_get_value(SHOW SLAVE STATUS, 'Master_Log_File', 1) + --let $cur_pos= query_get_value(SHOW SLAVE STATUS, 'Read_Master_Log_Pos', 1) + --let $continue= `SELECT '$cur_file' = '$fil_1' AND $cur_pos < $pos_trx1` + if ($continue) + { + --dec $count + if (!$count) + { + --echo **** ERROR: timeout waiting for Read_Master_Log_Pos($cur_pos) >= $pos_trx1 (file='$cur_file') ****" + --die Timeout waiting for IO thread to write master events to the relaylog + } + --sleep 0.1 + } +} + --let $pos_xid=508 --let $info= query_get_value(SHOW RELAYLOG EVENTS IN '$file_rl' FROM $pos_xid LIMIT 1, Info, 1)