Commit 6e0a00ed authored by Kristian Nielsen's avatar Kristian Nielsen

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.
parent f0be022c
......@@ -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
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment