Skip to content

Commit

Permalink
MDEV-10684: rpl.rpl_domain_id_filter_restart fails in buildbot
Browse files Browse the repository at this point in the history
The test failure in rpl.rpl_domain_id_filter_restart is caused by
MDEV-33887. That is, the test uses master_pos_wait() (called
indirectly by sync_slave_with_master) to try and wait for the
replica to catch up to the master. However, the waited on
transaction is ignored by the configured
  CHANGE MASTER TO IGNORE_DOMAIN_IDS=()
As MDEV-33887 reports, due to the IO thread updating the binlog
coordinates and the SQL thread updating the GTID state, if the
replica is stopped in-between these updates, the replica state will
be inconsistent. That is, the test expects that the GTID state will
be updated, so upon restart, the replica will be up-to-date.
However, if the replica is stopped before the SQL thread updates its
GTID state, then upon restart, the replica will fetch the previously
ignored event, which is no longer ignored upon restart, and execute
it. This leads to the sporadic extra row in t2.

This patch changes master_pos_wait() to use master_gtid_wait() to
ensure the replica state is consistent with the master state.
  • Loading branch information
bnestere committed Apr 11, 2024
1 parent 04be12a commit a6aecbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t2;
i
1
include/save_master_gtid.inc
connection slave;
connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1;
i
1
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ SET @@session.gtid_domain_id= 1;
INSERT INTO t2 VALUES(1);
SELECT * FROM t2;

sync_slave_with_master;
source include/save_master_gtid.inc;

connection slave;
source include/sync_with_master_gtid.inc;
SELECT * FROM t1;
SELECT * FROM t2;

Expand Down

0 comments on commit a6aecbb

Please sign in to comment.