Commit 74e581b7 authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-7037: MariaDB 10.0 does not build on Debian / kfreebsd-i386/amd64 due to...

MDEV-7037: MariaDB 10.0 does not build on Debian / kfreebsd-i386/amd64 due to MTR failure: multi_source.gtid
MDEV-7106: Sporadic test failure in multi_source.gtid
MDEV-7153: Yet another sporadic failure of multi_source.gtid in buildbot

This patch fixes three races in the multi_source.gtid test case that could
cause sporadic failures:

1. Do not put SHOW ALL SLAVES STATUS in the output, the output is not stable.

2. Ensure that slave1 has replicated as far as expected, before stopping its
connection to master1 (otherwise the following wait will time out due to rows
not replicated from master1).

3. Ensure that slave2 has replicated far enough before connecting slave1 to it
(otherwise we get an error during connect that slave1 is ahead of slave2).
parent 5ae1639c
......@@ -26,59 +26,6 @@ SET SQL_LOG_BIN=0;
CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10));
SET SQL_LOG_BIN=1;
INSERT INTO t3 VALUES (201, "initial 2");
SHOW ALL SLAVES STATUS;
Connection_name
Slave_SQL_State Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
Master_User root
Master_Port MYPORT_3
Connect_Retry 60
Master_Log_File server3-bin.000001
Read_Master_Log_Pos 1501
Relay_Log_File mysqld-relay-bin.000002
Relay_Log_Pos 1790
Relay_Master_Log_File server3-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 1501
Relay_Log_Space 2088
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master 0
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 3
Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Retried_transactions 0
Max_relay_log_size 1073741824
Executed_log_entries 25
Slave_received_heartbeats 0
Slave_heartbeat_period 60.000
Gtid_Slave_Pos 1-1-4,2-2-3
*** Now move slave2 to replicate from both master1 and master2 instead of just slave1 ***
STOP ALL SLAVES;
Warnings:
......@@ -102,9 +49,11 @@ INSERT INTO t1 VALUES (3, "switch 2");
INSERT INTO t3 VALUES (103, "switch 2 a");
INSERT INTO t2 VALUES (3, "switch 2");
INSERT INTO t3 VALUES (203, "switch 2 b");
include/save_master_gtid.inc
STOP SLAVE 'slave2';
INSERT INTO t2 VALUES (4, "switch 3");
INSERT INTO t3 VALUES (204, "switch 3 b");
include/sync_with_master_gtid.inc
CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
......
......@@ -58,8 +58,6 @@ INSERT INTO t3 VALUES (201, "initial 2");
--source include/wait_condition.inc
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=1 AND (SELECT COUNT(*) FROM t2)=1 AND (SELECT COUNT(*) FROM t3)=2
--source include/wait_condition.inc
--replace_result $SERVER_MYPORT_3 MYPORT_3
query_vertical SHOW ALL SLAVES STATUS;
--echo *** Now move slave2 to replicate from both master1 and master2 instead of just slave1 ***
STOP ALL SLAVES;
......@@ -93,6 +91,8 @@ set default_master_connection = '';
--connection slave1
# Set up so that slave1 will have to start from two different positions
# in the slave2 binlog (one for each domain_id).
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=2 AND (SELECT COUNT(*) FROM t2)=2 AND (SELECT COUNT(*) FROM t3)=4
--source include/wait_condition.inc
STOP SLAVE 'slave1';
--connection master1
......@@ -106,6 +106,7 @@ INSERT INTO t3 VALUES (103, "switch 2 a");
--connection master2
INSERT INTO t2 VALUES (3, "switch 2");
INSERT INTO t3 VALUES (203, "switch 2 b");
--source include/save_master_gtid.inc
--connection slave1
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=2 AND (SELECT COUNT(*) FROM t2)=3 AND (SELECT COUNT(*) FROM t3)=5
......@@ -116,6 +117,12 @@ STOP SLAVE 'slave2';
INSERT INTO t2 VALUES (4, "switch 3");
INSERT INTO t3 VALUES (204, "switch 3 b");
--connection slave2
# Make sure that slave2 has replicated far enough before connecting slave1 to
# it (otherwise we get an error that slave1 requested to start from a GTID
# which is not in slave2's binlogs).
--source include/sync_with_master_gtid.inc
--connection slave1
--replace_result $SERVER_MYPORT_4 MYPORT_4
eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment