MDEV-26: Global transaction ID

More fixes for test failures in Buildbot:

 - Do not run crashing test in Valgrind.

 - FLUSH TABLES did not work to avoid errors about not closed tables when
   crashing server. Suppress the messages instead.

 - Rewrite multi-source test case to only start one pair of slave threads at a
   time, to work-around the bug MDEV-4352.
This commit is contained in:
unknown 2013-04-02 14:44:24 +02:00
parent d639aece97
commit bdf6367d0e
4 changed files with 13 additions and 35 deletions

View File

@ -1,12 +1,10 @@
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
start all slaves;
Warnings:
Note 1937 SLAVE 'slave2' started
Note 1937 SLAVE 'slave1' started
set default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = 'slave2';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
CHANGE MASTER TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root';

View File

@ -15,10 +15,11 @@
eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'slave2';
START SLAVE;
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';

View File

@ -1,14 +1,14 @@
include/rpl_init.inc [topology=1->2]
*** Test crashing master, causing slave IO thread to reconnect while SQL thread is running ***
call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_GTID_POS=AUTO;
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
include/start_slave.inc
@ -26,9 +26,6 @@ SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid_list # # []
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
include/start_slave.inc
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (1);
@ -67,37 +64,22 @@ include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_write_rpl_slave_state";
START SLAVE;
INSERT INTO t1 VALUES (4);
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_before";
START SLAVE;
INSERT INTO t1 VALUES (5);
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_after";
START SLAVE;
INSERT INTO t1 VALUES (6);
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_flush_rli";
START SLAVE;
INSERT INTO t1 VALUES (7);
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_after_flush_rli";
START SLAVE;
INSERT INTO t1 VALUES (8);
SET sql_log_bin=0;
FLUSH TABLES;
SET sql_log_bin=1;
SELECT * FROM t1 ORDER BY a;
a
1

View File

@ -1,5 +1,7 @@
--source include/have_innodb.inc
--source include/have_debug.inc
# Valgrind does not work well with test that crashes the server
--source include/not_valgrind.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
@ -7,6 +9,10 @@
--echo *** Test crashing master, causing slave IO thread to reconnect while SQL thread is running ***
--connection server_1
call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
@ -20,9 +26,6 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
MASTER_GTID_POS=AUTO;
--connection server_1
# Attempt to get tables closed and avoid "table ... is marked as crashed"
# messages in error log.
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
@ -84,7 +87,6 @@ RESET MASTER;
--replace_column 2 # 4 # 5 #
SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--connection server_2
--source include/start_slave.inc
@ -153,7 +155,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
@ -179,7 +180,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 5 FROM t1
--source include/wait_condition.inc
@ -205,7 +205,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 6 FROM t1
--source include/wait_condition.inc
@ -231,7 +230,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 7 FROM t1
--source include/wait_condition.inc
@ -257,7 +255,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 8 FROM t1
--source include/wait_condition.inc