1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-28435: rpl.rpl_mysqlbinlog_slave_consistency fails intermittently on tables comparison

Problem:
========
The test logic checked for the wrong condition to validate that the
slave had caught up with the master. Specifically, it used the
thread stage of the IO and SQL thread to be in the “Waiting for
master to send event” and “Slave has read all relay log; waiting for
more updates” states, respectively. The problem exposed by this MDEV
is that, this state is also the initial slave state before reading
data from the primary (whereas the intended state was having already
read all available events from the primary and now waiting for new
events). This made the MTR test validate data that it had not yet
received, and thereby fail.

Solution:
========
Instead of using the IO/SQL thread states, use the existing helper
functions save_master_gtid.inc and sync_with_master_gtid.inc. Note
that the test result file also needed to be updated to reflect
this fix.

Special thanks to Angelique Sklavounos for pointing out that
--stop-position was not specified in any buildbot failures, as this
led to an IF block in the MTR test that was the source of the test
failure.

Reviewed By
============
Andrei Elkin <andrei.elkin@mariadb.com>
This commit is contained in:
Brandon Nesterenko
2022-04-28 10:06:47 -06:00
parent 504a3b32f6
commit 51b28b24ca
2 changed files with 2 additions and 37 deletions

View File

@@ -54,6 +54,7 @@ if ($strict_mode)
--connection $con1
--echo # Populating $con1 data
--source $sql_input_file
--source include/save_master_gtid.inc
--let $MYSQLD_DATADIR=`select @@datadir`
--let $MYSQLBINLOG_STDERR=$MYSQLD_DATADIR/mysqlbinlog_stderr.out
@@ -114,15 +115,7 @@ if (!$slave_sql_errno)
# Stop position was not specified
if (`SELECT strcmp("$stop_position","") = 0`)
{
--source include/wait_for_slave_to_start.inc
--echo # Wait for $con2 IO thread to catch up
--let $wait_condition= SELECT STATE="Waiting for master to send event" from information_schema.PROCESSLIST where COMMAND="Slave_IO"
--source include/wait_condition.inc
--echo # Wait for $con2 SQL thread to catch up
--let $wait_condition= SELECT STATE="Slave has read all relay log; waiting for more updates" from information_schema.PROCESSLIST where COMMAND="Slave_SQL"
--source include/wait_condition.inc
--source include/sync_with_master_gtid.inc
}
# Stop position was specified