From 6e0a00ed7534eee7afce8f1cfa168d77d0832d5d Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 6 Jan 2015 09:52:09 +0100 Subject: [PATCH] MDEV-7353: rpl_mdev6386 fails sporadically in buildbot 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. --- mysql-test/suite/rpl/r/rpl_mdev6386.result | 2 ++ mysql-test/suite/rpl/t/rpl_mdev6386.test | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_mdev6386.result b/mysql-test/suite/rpl/r/rpl_mdev6386.result index 352b9d07fef..fa49d9a9c03 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev6386.result +++ b/mysql-test/suite/rpl/r/rpl_mdev6386.result @@ -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 @@ -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 diff --git a/mysql-test/suite/rpl/t/rpl_mdev6386.test b/mysql-test/suite/rpl/t/rpl_mdev6386.test index 5513d15a77d..3e4e79ea5a3 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev6386.test +++ b/mysql-test/suite/rpl/t/rpl_mdev6386.test @@ -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; @@ -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;