Fix sporadic test failure in rpl_gtid_mdev4820.test

Use sync_with_master_gtid.inc instead of --sync_with_master. The latter is
not correct because the test case uses RESET MASTER; this invalidates the
existing binlog positions on the slave.

In this particular case, there was a small window where --sync_with_master
could trigger too early (on the old position), causing the test case to miss
one event.
This commit is contained in:
Kristian Nielsen 2015-09-22 13:35:23 +02:00
parent 81727cd774
commit fea156813a
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@ RESET MASTER;
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS';
include/start_slave.inc include/start_slave.inc
INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
SET sql_log_bin= 0; SET sql_log_bin= 0;
CALL mtr.add_suppression("The binlog on the master is missing the GTID"); CALL mtr.add_suppression("The binlog on the master is missing the GTID");
SET sql_log_bin= 1; SET sql_log_bin= 1;
@ -25,6 +26,7 @@ include/wait_for_slave_io_error.inc [errno=1236]
STOP SLAVE SQL_THREAD; STOP SLAVE SQL_THREAD;
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS';
include/start_slave.inc include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1

View File

@ -34,7 +34,7 @@ eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos';
--connection server_1 --connection server_1
INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (4);
--save_master_pos --source include/save_master_gtid.inc
--connection server_2 --connection server_2
SET sql_log_bin= 0; SET sql_log_bin= 0;
@ -48,7 +48,7 @@ STOP SLAVE SQL_THREAD;
eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos';
--source include/start_slave.inc --source include/start_slave.inc
--sync_with_master --source include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
--source include/stop_slave.inc --source include/stop_slave.inc