1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-28 17:36:30 +03:00
Files
mariadb/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
unknown 7ad47ab0e0 MDEV-4605: Failing to load GTID slave position from rpl.gtid_slave_pos
There were several cases where the slave GTID position was not loaded
correctly before being used. This caused various failures such as
corrupting the position at slave start and empty values of
@@gtid_slave_pos and @@gtid_current_pos.

Fixed by adding more checks for loaded position, and by always loading
the position at server startup.
2013-06-03 07:41:38 +02:00

65 lines
2.0 KiB
Plaintext

include/rpl_init.inc [topology=1->2]
*** Test normal shutdown/restart of slave server configured as a GTID slave. ***
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
include/stop_slave.inc
Master_Log_File = 'master-bin.000001'
Using_Gtid = 'No'
CHANGE MASTER TO master_use_gtid=current_pos;
FLUSH LOGS;
include/wait_for_purge.inc "master-bin.000002"
show binary logs;
Log_name File_size
master-bin.000002 #
INSERT INTO t1 VALUES (2);
FLUSH LOGS;
INSERT INTO t1 VALUES (3);
show binary logs;
Log_name File_size
master-bin.000002 #
master-bin.000003 #
SELECT * FROM t1 ORDER BY a;
a
1
2
3
*** Test normal shutdown/restart of master server, check binlog state is preserved. ***
SET SESSION gtid_domain_id= 1;
INSERT INTO t1 VALUES (4);
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 # # [0-1-3]
FLUSH LOGS;
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-1,0-1-4]
SHOW BINLOG EVENTS IN 'master-bin.000005' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000005 # Gtid_list # # [1-1-1,0-1-4]
show binary logs;
Log_name File_size
master-bin.000002 #
master-bin.000003 #
master-bin.000004 #
master-bin.000005 #
INSERT INTO t1 VALUES(5);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
*** Test that @@gtid_slave_pos and @@gtid_current_pos are correctly loaded even if slave threads have not started. ***
SET @slave_pos2= @@GLOBAL.gtid_slave_pos;
SET @current_pos2= @@GLOBAL.gtid_current_pos;
SELECT IF(@slave_pos1=@slave_pos2, "OK", CONCAT(@slave_pos1, " != ", @slave_pos2));
IF(@slave_pos1=@slave_pos2, "OK", CONCAT(@slave_pos1, " != ", @slave_pos2))
OK
SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2));
IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2))
OK
include/start_slave.inc
DROP TABLE t1;
include/rpl_end.inc