Bug #80393 Slave has more GTIDs than the master has after the mysqld restarted abnormally
Submitted: 16 Feb 2016 12:32 Modified: 16 Feb 2016 15:17
Reporter: Tim Smith Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.6.24/5.6.28 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[16 Feb 2016 12:32] Tim Smith
Description:
There is a 5.6.24 master with GTID and a 5.6.28 slave replicating from the master with GTID. Both IO thread and SQL threads are running. However, the slave complains "Slave has more GTIDs than the master has" after the mysqld on the master is killed abnormally and restarted.

How to repeat:
1. Setup up a replication with a 5.6.24 master and a 5.6.28 slave. GTID are both enabled on both machines. 
2. On the master, make sure the sync_binlog is 1 and innodb_flush_log_at_trx_commit is 1.
3. On the slave, make sure sync_binlog is 1 and innodb_flush_log_at_trx_commit is 1. Also, set master_info_repository = TABLE, master_info_repository = TABLE, relay_log_recovery = ON and slave_parallel_workers=1.
4. On the slave, issue "start slave" and make sure both IO thread and SQL threads are running.
5. On the master, stress it with a very heavy write workload.
6. Unplugged the power cable of the master machine to kill mysqld.
7. Re-plug the power cable to the master machine and start it and then start mysqld.
8. The slave complains "Slave has more GTIDs than the master". 

Suggested fix:
Please fix so that the slave can still continue replicating after the master server is crashed and restarted.