1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
################################################################################
# Bug#20464737 SEMI_SYNC: SLAVE IO FAILS WITH ER1236 'SLAVE HAS MORE GTIDS THAN
# THE MASTER HAS'
#
# Slaves, especially semisync slaves, encountered ER1236 when connecting to
# their masters. When connecting to the master with COM_GTID_DUMP request,
# the slave sends all replicated gtids to master and master checks if all the
# slave gtids(only the gtids have master's uuid) are included in master's
# gtid_executed. However, there is a chance that a gtid is already in slave's
# gtid_executed, but not in master's gtid_executed. Gtid is added into
# gtid_executed after it is binlogged, so it is possible that a transaction is
# replicated and applied on slave, but not committed on master yet.
#
# To fix it, master will check if all gtids are in the set of (gtid_executed,
# owned_gtids).
################################################################################
--source include/not_group_replication_plugin.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
CREATE TABLE t1(c1 INT);
# The transaction will not commit until it get 'continue' signal.
SET debug_sync = "bgc_after_sync_stage_before_commit_stage SIGNAL synced WAIT_FOR continue";
--send INSERT INTO t1 VALUES(1)
--let $rpl_connection_name= default
--source include/rpl_connection.inc
SET debug_sync = "now WAIT_FOR synced";
--source include/sync_slave_sql_with_master.inc
# After the transaction is replicated, io thread should be able to connect.
--source include/stop_slave_io.inc
--source include/start_slave_io.inc
--let $rpl_connection_name= default
--source include/rpl_connection.inc
SET debug_sync = "now SIGNAL continue";
--source include/rpl_connection_master.inc
--reap
INSERT INTO t1 VALUES(2);
DROP TABLE t1;
--source include/rpl_end.inc
|