MySQL

MySQL Master-Master Replication Bug – ERROR 1872

Description:
When i tried to configurate a crash safe slave with MTS and GTID based replication, but after a OS crash
replication failed to be start.

And, “start slave” also failed

According the manual, When using GTIDs and MASTER_AUTO_POSITION “sync_relay_log=1” is not necessary.
http://dev.mysql.com/doc/refman/5.6/en/replication-solutions-unexpected-slave-halt.html

How to repeat:
STEP1:
run a script to execute update sql on the master continuously

STEP2:
use “kill -9” kill the kvm process of the slave in the physical machine

STEP3:
start mysql of the slave

Suggested fix:
The error ocuurs when mts_recovery_groups() reading the corrupted relay log files in MTS group recovery.
But with “gtid_mode=ON” and “relay_log_recovery = 1”, the relay log files will be discard later, and so, at the beginning should skip the relay log read.

workaround:
The following steps can start slave successfully

Don’t forget to add below line to my.cnf to skip erros

Leave a Reply

Your email address will not be published. Required fields are marked *