mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-4475: Replication from MariaDB 10.0 to 5.5 does not work
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.
This commit is contained in:
@ -3,11 +3,11 @@ RESET MASTER;
|
||||
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 484
|
||||
master-bin.000001 486
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
Binlog_snapshot_file master-bin.000001
|
||||
Binlog_snapshot_position 484
|
||||
Binlog_snapshot_position 486
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (0, "");
|
||||
# Connection con1
|
||||
@ -38,10 +38,10 @@ a b
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
Binlog_snapshot_file master-bin.000001
|
||||
Binlog_snapshot_position 986
|
||||
Binlog_snapshot_position 988
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 1338
|
||||
master-bin.000001 1340
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
2
|
||||
@ -60,7 +60,7 @@ a b
|
||||
SHOW STATUS LIKE 'binlog_snapshot_%';
|
||||
Variable_name Value
|
||||
Binlog_snapshot_file master-bin.000001
|
||||
Binlog_snapshot_position 986
|
||||
Binlog_snapshot_position 988
|
||||
SHOW MASTER STATUS;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 367
|
||||
@ -75,33 +75,33 @@ master-bin.000002 367
|
||||
SHOW BINLOG EVENTS;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: #
|
||||
master-bin.000001 248 Gtid_list 1 271 []
|
||||
master-bin.000001 271 Binlog_checkpoint 1 311 master-bin.000001
|
||||
master-bin.000001 311 Gtid 1 349 GTID 0-1-1
|
||||
master-bin.000001 349 Query 1 484 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
|
||||
master-bin.000001 484 Gtid 1 522 GTID 0-1-2
|
||||
master-bin.000001 522 Query 1 634 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
|
||||
master-bin.000001 634 Gtid 1 672 BEGIN GTID 0-1-3
|
||||
master-bin.000001 672 Query 1 760 use `test`; INSERT INTO t2 VALUES (2)
|
||||
master-bin.000001 760 Query 1 829 COMMIT
|
||||
master-bin.000001 829 Gtid 1 867 BEGIN GTID 0-1-4
|
||||
master-bin.000001 867 Query 1 959 use `test`; INSERT INTO t1 VALUES (0, "")
|
||||
master-bin.000001 959 Xid 1 986 COMMIT /* XID */
|
||||
master-bin.000001 986 Gtid 1 1024 BEGIN GTID 0-1-5
|
||||
master-bin.000001 1024 Query 1 1112 use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 1112 Query 1 1181 COMMIT
|
||||
master-bin.000001 1181 Gtid 1 1219 BEGIN GTID 0-1-6
|
||||
master-bin.000001 1219 Query 1 1311 use `test`; INSERT INTO t1 VALUES (4, "")
|
||||
master-bin.000001 1311 Xid 1 1338 COMMIT /* XID */
|
||||
master-bin.000001 1338 Gtid 1 1376 BEGIN GTID 0-1-7
|
||||
master-bin.000001 1376 Query 1 1468 use `test`; INSERT INTO t1 VALUES (1, "")
|
||||
master-bin.000001 1468 Xid 1 1495 COMMIT /* XID */
|
||||
master-bin.000001 1495 Gtid 1 1533 BEGIN GTID 0-1-8
|
||||
master-bin.000001 1533 Query 1 1630 use `test`; INSERT INTO t1 VALUES (2, "first")
|
||||
master-bin.000001 1630 Query 1 1728 use `test`; INSERT INTO t1 VALUES (2, "second")
|
||||
master-bin.000001 1728 Xid 1 1755 COMMIT /* XID */
|
||||
master-bin.000001 1755 Gtid 1 1793 BEGIN GTID 0-1-9
|
||||
master-bin.000001 1793 Query 1 1885 use `test`; INSERT INTO t1 VALUES (3, "")
|
||||
master-bin.000001 1885 Xid 1 1912 COMMIT /* XID */
|
||||
master-bin.000001 1912 Rotate 1 1956 master-bin.000002;pos=4
|
||||
master-bin.000001 248 Gtid_list 1 273 []
|
||||
master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
|
||||
master-bin.000001 313 Gtid 1 351 GTID 0-1-1
|
||||
master-bin.000001 351 Query 1 486 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
|
||||
master-bin.000001 486 Gtid 1 524 GTID 0-1-2
|
||||
master-bin.000001 524 Query 1 636 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
|
||||
master-bin.000001 636 Gtid 1 674 BEGIN GTID 0-1-3
|
||||
master-bin.000001 674 Query 1 762 use `test`; INSERT INTO t2 VALUES (2)
|
||||
master-bin.000001 762 Query 1 831 COMMIT
|
||||
master-bin.000001 831 Gtid 1 869 BEGIN GTID 0-1-4
|
||||
master-bin.000001 869 Query 1 961 use `test`; INSERT INTO t1 VALUES (0, "")
|
||||
master-bin.000001 961 Xid 1 988 COMMIT /* XID */
|
||||
master-bin.000001 988 Gtid 1 1026 BEGIN GTID 0-1-5
|
||||
master-bin.000001 1026 Query 1 1114 use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 1114 Query 1 1183 COMMIT
|
||||
master-bin.000001 1183 Gtid 1 1221 BEGIN GTID 0-1-6
|
||||
master-bin.000001 1221 Query 1 1313 use `test`; INSERT INTO t1 VALUES (4, "")
|
||||
master-bin.000001 1313 Xid 1 1340 COMMIT /* XID */
|
||||
master-bin.000001 1340 Gtid 1 1378 BEGIN GTID 0-1-7
|
||||
master-bin.000001 1378 Query 1 1470 use `test`; INSERT INTO t1 VALUES (1, "")
|
||||
master-bin.000001 1470 Xid 1 1497 COMMIT /* XID */
|
||||
master-bin.000001 1497 Gtid 1 1535 BEGIN GTID 0-1-8
|
||||
master-bin.000001 1535 Query 1 1632 use `test`; INSERT INTO t1 VALUES (2, "first")
|
||||
master-bin.000001 1632 Query 1 1730 use `test`; INSERT INTO t1 VALUES (2, "second")
|
||||
master-bin.000001 1730 Xid 1 1757 COMMIT /* XID */
|
||||
master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9
|
||||
master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "")
|
||||
master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */
|
||||
master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4
|
||||
DROP TABLE t1,t2;
|
||||
|
Reference in New Issue
Block a user