commit 2841b9521d0438ac8f317507f292fe6e6ab660e6 Author: Jeremy Cole Date: Thu Jun 27 14:06:36 2013 -0700 Fix race waiting for rows to appear on slave vs. GTID The rpl_gtid_stop_start test used "SELECT COUNT(*)" as a wait_condition when waiting for rows to appear from the replication stream. Since the table it is waiting on is MyISAM, rows appearing there do not guarantee in any way that the GTID information will have been updated by the slave thread (and can't guarantee that). This causes a race in the test which is especially exacerbated by making the gtid_slave_pos table InnoDB, since then the COMMIT that is done as part of recording the GTID is bound to take some tens of milliseconds. Instead of using "SELECT COUNT(*)" as a wait_condition, read the gtid_slave_pos variable itself, similar to how non-GTID tests wait for specific master log positions. Change-Id: Ie897bf3b82039958508881e83e03f71066f59501 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test index fda310d..8abd76b 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test @@ -50,7 +50,7 @@ EOF --enable_reconnect --source include/wait_until_connected_again.inc ---let $wait_condition= SELECT COUNT(*) = 3 FROM t1 +--let $wait_condition= SELECT @@GLOBAL.gtid_slave_pos = "0-1-4" --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a; @@ -90,7 +90,7 @@ SHOW BINLOG EVENTS IN 'master-bin.000005' LIMIT 1,1; INSERT INTO t1 VALUES(5); --connection server_2 ---let $wait_condition= SELECT COUNT(*) = 5 FROM t1 +--let $wait_condition= SELECT @@GLOBAL.gtid_slave_pos = "1-1-1,0-1-5" --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a;