summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2014-02-07 20:24:39 +0100
committerunknown <knielsen@knielsen-hq.org>2014-02-07 20:24:39 +0100
commit7bb022f3cf1971c90295ed882712ed84079bda20 (patch)
tree9bac90204880c927dd385f439b185ae8a1d8a4ed /mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
parent4e6606acad4ad0ea75dec114ad316e0325efaf02 (diff)
downloadmariadb-git-7bb022f3cf1971c90295ed882712ed84079bda20.tar.gz
MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
Some GTID test cases were using include/wait_condition.inc with a condition like SELECT COUNT(*)=4 FROM t1 to wait for the slave to catch up with the master. This causes races and test failures, as the changes to the tables become visible at the COMMIT of the SQL thread (or even before in case of MyISAM), but the changes to @@gtid_slave_pos only become visible a little bit after the COMMIT. Now that we have MASTER_GTID_WAIT(), just use that to sync up in a GTID-friendly way, wrapped in nice include/save_master_gtid.inc and include/sync_with_master_gtid.inc scripts.
Diffstat (limited to 'mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test')
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
index 1e33520efb5..a5caebf0276 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
@@ -32,12 +32,12 @@ START SLAVE;
--connection server_2
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
+--source include/save_master_gtid.inc
--source include/show_binlog_events.inc
--connection server_1
---let $wait_condition= SELECT COUNT(*) = 4 FROM t1
---source include/wait_condition.inc
+--source include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -45,14 +45,14 @@ SELECT * FROM t1 ORDER BY a;
RESET SLAVE;
INSERT INTO t1 VALUES (5, 1);
INSERT INTO t1 VALUES (6, 1);
+--source include/save_master_gtid.inc
--connection server_2
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
master_use_gtid = current_pos;
START SLAVE;
---let $wait_condition= SELECT COUNT(*) = 6 FROM t1
---source include/wait_condition.inc
+--source include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;