Commit 553a4d62 authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-33602: Sporadic test failure in rpl.rpl_gtid_stop_start

The test could fail with a duplicate key error because switching to non-GTID
mode could start at the wrong old-style position. The position could be
wrong when the previous GTID connect was stopped before receiving the fake
GTID list event which gives the old-style position corresponding to the GTID
connected position.

Work-around by injecting an extra event and syncing the slave before
switching to non-GTID mode.
Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
parent a1c1f502
......@@ -112,6 +112,10 @@ a
6
7
*** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
connection server_1;
INSERT INTO t1 VALUES (8);
DELETE FROM t1 WHERE a=8;
connection server_2;
connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid= no;
......
......@@ -170,6 +170,24 @@ SELECT * FROM t1 ORDER BY a;
--echo *** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
# In GTID mode, the old-style replication position is also updated. But during
# GTID connect, the old-style position is not known until receiving the fake
# GTID list event, which contains the required position value. If we happened
# to stop the slave above before this fake GTID list event, the test could fail
# with duplicate key errors due to switching to non-GTID mode at a wrong
# position too far back in the binlog.
#
# Work-around this by injecting an extra dummt event and syncing the slave to
# it, ensuring the old-style position will be updated.
#
# This work-around could be removed after MDEV-33996 is fixed.
--connection server_1
INSERT INTO t1 VALUES (8);
DELETE FROM t1 WHERE a=8;
--save_master_pos
--connection server_2
--sync_with_master
--connection server_2
--source include/stop_slave.inc
CHANGE MASTER TO master_use_gtid= no;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment