mariadb/mysql-test/include/save_master_gtid.inc
unknown 7bb022f3cf 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.
2014-02-07 20:24:39 +01:00

28 lines
578 B
PHP

# ==== Purpose ====
#
# Save the current binlog GTID position on the master, to be used
# with include/sync_with_master_gtid.inc.
#
#
# ==== Usage ====
#
# [--let $rpl_debug= 1]
# --source include/save_master_gtid.inc
#
# Parameters:
# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= save_master_gtid.inc
--source include/begin_include_file.inc
--let $master_pos= `SELECT @@gtid_binlog_pos`
if ($rpl_debug)
{
--echo save_master_gtid saved master_pos='$master_pos'
}
--let $include_filename= save_master_gtid.inc
--source include/end_include_file.inc