mirror of
https://github.com/MariaDB/server.git
synced 2025-02-09 23:24:11 +01:00
76 lines
1.9 KiB
Text
76 lines
1.9 KiB
Text
#
|
|
# Tests the wsrep_sync_wait_upto variable.
|
|
#
|
|
|
|
--source include/galera_cluster.inc
|
|
--source include/have_debug.inc
|
|
--source include/have_debug_sync.inc
|
|
|
|
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES (1);
|
|
|
|
# Test with invalid values
|
|
|
|
--error ER_WRONG_ARGUMENTS
|
|
SELECT WSREP_SYNC_WAIT_UPTO_GTID(NULL);
|
|
|
|
--error ER_INCORRECT_GTID_STATE
|
|
SELECT WSREP_SYNC_WAIT_UPTO_GTID('a');
|
|
|
|
--error ER_INCORRECT_GTID_STATE
|
|
SELECT WSREP_SYNC_WAIT_UPTO_GTID(2);
|
|
|
|
--error ER_WRONG_ARGUMENTS
|
|
SELECT WSREP_SYNC_WAIT_UPTO_GTID('1-1-1,1-1-2');
|
|
|
|
# Expected starting seqno
|
|
|
|
--let $last_seen_gtid = `SELECT WSREP_LAST_SEEN_GTID()`
|
|
--let $s1 = `SELECT SUBSTR('$last_seen_gtid', LOCATE('-', '$last_seen_gtid') + LENGTH('-'))`
|
|
--let $start_seqno = `SELECT SUBSTR('$s1', LOCATE('-', '$s1') + LENGTH('-'))`
|
|
|
|
# If set to low value, expect no waiting
|
|
|
|
--disable_query_log
|
|
--let $lower_seqno = $start_seqno
|
|
--dec $lower_seqno
|
|
--eval SELECT WSREP_SYNC_WAIT_UPTO_GTID('100-1-$lower_seqno') AS WSREP_SYNC_WAIT_UPTO;
|
|
--enable_query_log
|
|
|
|
# If set to current last_committed value no waiting
|
|
|
|
--disable_query_log
|
|
--let $wsrep_last_committed_gtid = `SELECT WSREP_LAST_SEEN_GTID()`
|
|
--eval SELECT WSREP_SYNC_WAIT_UPTO_GTID('$wsrep_last_committed_gtid') AS WSREP_SYNC_WAIT_UPTO;
|
|
--enable_query_log
|
|
|
|
|
|
# Timeout if GTID is not received on time
|
|
|
|
--disable_query_log
|
|
--let $high_seqno = $start_seqno
|
|
--inc $high_seqno
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
--eval SELECT WSREP_SYNC_WAIT_UPTO_GTID('100-1-$high_seqno', 1) AS WSREP_SYNC_WAIT_UPTO;
|
|
--enable_query_log
|
|
|
|
# Wait for GTID value
|
|
|
|
--connection node_2
|
|
--disable_query_log
|
|
--let $wait_seqno = $start_seqno
|
|
--inc $wait_seqno
|
|
--send_eval SELECT WSREP_SYNC_WAIT_UPTO_GTID('100-1-$wait_seqno') AS WSREP_SYNC_WAIT_UPTO
|
|
--enable_query_log
|
|
|
|
--connection node_1
|
|
INSERT INTO t1 VALUES (2);
|
|
|
|
--connection node_2
|
|
--reap
|
|
|
|
--connection node_1
|
|
DROP TABLE t1;
|
|
|
|
--connection node_2
|
|
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|