diff options
author | unknown <knielsen@knielsen-hq.org> | 2014-02-10 12:39:26 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2014-02-10 12:39:26 +0100 |
commit | fefdb576bb6b49adcff914f909429781452dd7bf (patch) | |
tree | 9a9e5f5f6e796e4e621eb593ed7992be57aa3683 /mysql-test/include | |
parent | 8cc6e90d74f4377491bcb7a0f1acd41ccf9fbcae (diff) | |
parent | 4a976545e518e70d5124e356a057c8d9624038a3 (diff) | |
download | mariadb-git-fefdb576bb6b49adcff914f909429781452dd7bf.tar.gz |
Merge of MDEV-4984, MDEV-4726, and MDEV-5636 into 10.0-base.
MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
MDEV-5636: Deadlock in RESET MASTER
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/save_master_gtid.inc | 28 | ||||
-rw-r--r-- | mysql-test/include/sync_with_master_gtid.inc | 48 |
2 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/include/save_master_gtid.inc b/mysql-test/include/save_master_gtid.inc new file mode 100644 index 00000000000..4fd0d3266a2 --- /dev/null +++ b/mysql-test/include/save_master_gtid.inc @@ -0,0 +1,28 @@ +# ==== 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 diff --git a/mysql-test/include/sync_with_master_gtid.inc b/mysql-test/include/sync_with_master_gtid.inc new file mode 100644 index 00000000000..97ada8eea29 --- /dev/null +++ b/mysql-test/include/sync_with_master_gtid.inc @@ -0,0 +1,48 @@ +# ==== Purpose ==== +# +# Wait until the slave has reached a certain GTID position. +# Similar to --sync_with_master, but using GTID instead of old-style +# binlog file/offset coordinates. +# +# +# ==== Usage ==== +# +# --let $master_pos= `SELECT @@GLOBAL.gtid_binlog_pos` +# [--let $slave_timeout= NUMBER] +# [--let $rpl_debug= 1] +# --source include/sync_with_master_gtid.inc +# +# Syncs slave to the specified GTID position. +# +# Must be called on the slave. +# +# Parameters: +# $master_pos +# The GTID position to sync to. Typically obtained from +# @@GLOBAL.gtid_binlog_pos on the master. +# +# $slave_timeout +# Timeout in seconds. The default is 2 minutes. +# +# $rpl_debug +# See include/rpl_init.inc + +--let $include_filename= sync_with_master_gtid.inc +--source include/begin_include_file.inc + +let $_slave_timeout= $slave_timeout; +if (!$_slave_timeout) +{ + let $_slave_timeout= 120; +} + +--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)` +if ($_result == -1) +{ + --let $_current_gtid_pos= `SELECT @@GLOBAL.gtid_slave_pos` + --echo Timeout in master_gtid_wait('$master_pos', $_slave_timeout), current slave GTID position is: $_current_gtid_pos. + --die Failed to sync with master +} + +--let $include_filename= sync_with_master_gtid.inc +--source include/end_include_file.inc |