mirror of
https://github.com/MariaDB/server.git
synced 2025-11-28 17:36:30 +03:00
The problem was the Gtid_list event which is logged to the binlog in 10.0 and is not understood by the 5.5 server. This event is supposed to be replaced with a dummy event for 5.5 servers. But the very first event logged in the very first binlog has an empty list of GTID, which makes the event too short to be replacable with an empty event. The fix is to pad the empty Gtid_list event to be big enough to be replacable by a dummy event.
112 lines
3.6 KiB
Plaintext
112 lines
3.6 KiB
Plaintext
--source include/master-slave.inc
|
|
--source include/have_debug.inc
|
|
--source include/have_binlog_format_row.inc
|
|
|
|
connection master;
|
|
|
|
set @old_master_binlog_checksum= @@global.binlog_checksum;
|
|
set @old_slave_dbug= @@global.debug_dbug;
|
|
|
|
# MDEV-4475: Cannot replicate to old server when binlog contains
|
|
# empty Gtid_list event
|
|
#
|
|
# Test this by binlog rotation before we log any GTIDs.
|
|
connection slave;
|
|
--source include/stop_slave.inc
|
|
--echo # Test slave with no capability gets dummy event, which is ignored.
|
|
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
|
|
--source include/start_slave.inc
|
|
|
|
connection master;
|
|
FLUSH LOGS;
|
|
CREATE TABLE t1 (a INT PRIMARY KEY);
|
|
INSERT INTO t1 VALUES (0);
|
|
sync_slave_with_master;
|
|
|
|
connection master;
|
|
# Add a dummy event just to have something to sync_slave_with_master on.
|
|
# Otherwise we occasionally get different $relaylog_start, depending on
|
|
# whether Format_description_log_event was written to relay log or not
|
|
# at the time of SHOW SLAVE STATUS.
|
|
ALTER TABLE t1 ORDER BY a;
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
|
|
|
|
connection master;
|
|
SET SESSION binlog_annotate_row_events = ON;
|
|
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
|
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
|
# A short event, to test when we need to use user_var_event for dummy event.
|
|
DELETE FROM t1;
|
|
INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1);
|
|
let $binlog_limit= 0, 10;
|
|
--source include/show_binlog_events.inc
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
|
|
SELECT * FROM t1;
|
|
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
|
|
let $binlog_start= $relaylog_start;
|
|
let $binlog_limit=0,10;
|
|
--source include/show_relaylog_events.inc
|
|
set @@global.debug_dbug= @old_slave_dbug;
|
|
|
|
--echo # Test dummy event is checksummed correctly.
|
|
|
|
connection master;
|
|
set @@global.binlog_checksum = CRC32;
|
|
TRUNCATE t1;
|
|
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
|
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
|
INSERT INTO t1 VALUES(2);
|
|
let $binlog_limit= 0, 5;
|
|
--source include/show_binlog_events.inc
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
|
|
SELECT * FROM t1;
|
|
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
|
|
let $binlog_start= 0;
|
|
let $binlog_limit=7,5;
|
|
--source include/show_relaylog_events.inc
|
|
|
|
--echo # Test that slave which cannot tolerate holes in binlog stream but
|
|
--echo # knows the event does not get dummy event
|
|
|
|
--source include/stop_slave.inc
|
|
SET @@global.debug_dbug='+d,simulate_slave_capability_old_53';
|
|
--source include/start_slave.inc
|
|
connection master;
|
|
ALTER TABLE t1 ORDER BY a;
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
|
|
|
|
connection master;
|
|
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
|
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
|
UPDATE t1 SET a = 3;
|
|
let $binlog_limit= 0, 5;
|
|
--source include/show_binlog_events.inc
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
|
|
SELECT * FROM t1;
|
|
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
|
|
let $binlog_start= $relaylog_start;
|
|
let $binlog_limit=0,5;
|
|
--source include/show_relaylog_events.inc
|
|
|
|
select @@global.log_slave_updates;
|
|
select @@global.replicate_annotate_row_events;
|
|
|
|
set @@global.debug_dbug= @old_slave_dbug;
|
|
|
|
--echo Clean up.
|
|
connection master;
|
|
set @@global.binlog_checksum = @old_master_binlog_checksum;
|
|
DROP TABLE t1;
|
|
sync_slave_with_master;
|
|
--source include/rpl_end.inc
|