mariadb/mysql-test/suite/rpl/r/rpl_gtid_crash.result
unknown b0389850a5 MDEV-26: Global transaction ID.
Test crashing the master, check that it recovers the binlog state.

Fix one bug introduced by previous commit (crash-recoved binlog state was
overwritten by loading stale binlog state file).

Fix Windows build error.
2013-03-27 19:29:59 +01:00

60 lines
1.8 KiB
Text

include/rpl_init.inc [topology=1->2]
*** Test crashing master, causing slave IO thread to reconnect while SQL thread is running ***
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;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
include/start_slave.inc
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
INSERT INTO t1 VALUES (1000, 3);
DROP TABLE t1;
*** Test crashing the master mysqld and check that binlog state is recovered. ***
include/stop_slave.inc
RESET MASTER;
CHANGE MASTER TO master_gtid_pos='';
RESET MASTER;
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;
include/start_slave.inc
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
FLUSH LOGS;
SET gtid_domain_id= 2;
INSERT INTO t1 VALUES (3);
FLUSH LOGS;
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
master-bin.000003 #
SHOW BINLOG EVENTS IN 'master-bin.000003' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000003 # Gtid_list # # [1-1-3,2-1-4,0-1-1]
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
master-bin.000003 #
master-bin.000004 #
SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000004 # Gtid_list # # [1-1-3,0-1-1,2-1-4]
SELECT * FROM t1 ORDER BY a;
a
1
2
3
DROP TABLE t1;
include/rpl_end.inc