Skip to content

Commit

Permalink
MDEV-7353: rpl_mdev6386 fails sporadically in buildbot
Browse files Browse the repository at this point in the history
Use include/sync_with_master_gtid.inc instead of --sync_with_master to avoid a
race in the test case.

In parallel replication, the old-style slave position (which is used by
--sync_with_master) is updated out-of-order between parallel threads. This
makes it possible for the position to be updated past DROP TEMPORARY TABLE t2
just before the commit of INSERT INTO t1 SELECT * FROM t2 becomes visible.

In this case, there is a small window where a SELECT just after
--sync_with_master may not see the changes from the INSERT.
  • Loading branch information
knielsen committed Jan 6, 2015
1 parent f0be022 commit 6e0a00e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mysql-test/suite/rpl/r/rpl_mdev6386.result
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ INSERT INTO t2 VALUE (4, 1);
INSERT INTO t2 VALUE (5, 1);
INSERT INTO t1 SELECT * FROM t2;
DROP TEMPORARY TABLE t2;
include/save_master_gtid.inc
Contents on master:
SELECT * FROM t1 ORDER BY a;
a b
Expand All @@ -41,6 +42,7 @@ SET sql_log_bin= 0;
DELETE FROM t1 WHERE a=1;
SET sql_log_bin= 1;
include/start_slave.inc
include/sync_with_master_gtid.inc
Contents on slave after:
SELECT * FROM t1 ORDER BY a;
a b
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/rpl/t/rpl_mdev6386.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ INSERT INTO t2 VALUE (4, 1);
INSERT INTO t2 VALUE (5, 1);
INSERT INTO t1 SELECT * FROM t2;
DROP TEMPORARY TABLE t2;
--save_master_pos
--source include/save_master_gtid.inc
--echo Contents on master:
SELECT * FROM t1 ORDER BY a;

Expand All @@ -56,7 +56,7 @@ DELETE FROM t1 WHERE a=1;
SET sql_log_bin= 1;

--source include/start_slave.inc
--sync_with_master
--source include/sync_with_master_gtid.inc
--echo Contents on slave after:
SELECT * FROM t1 ORDER BY a;

Expand Down

0 comments on commit 6e0a00e

Please sign in to comment.