Get missed transactions from slave
-
01-11-2019 - |
Question
I'm trying to write a disaster recovery plan, I have one way replication with 1 master(A) and 3 slaves(B,C,D)
A
/|\
/ | \
B C D
Let's say my master crash, and I loose all data on that server, I still have 3 slaves, and I'll promote the most up-to-date to be my new master, let say slave B is up to date and C and D are not, at the point I promote B to master my slaves have the follow result for SHOW SLAVE STATUS\G
:
slaveB> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Relay_Master_Log_File: master-bin.000002
Exec_Master_Log_Pos: 1476884
slaveC> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Relay_Master_Log_File: master-bin.000002
Exec_Master_Log_Pos: 78684
slaveD> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Relay_Master_Log_File: master-bin.000001
Exec_Master_Log_Pos: 746848
In order to promote B to master, I want to apply all missing transactions on C and D, so before B become the new master and start to receive queries from applications, I've all slaves on a consistent state, how can I find the missed transactions from C and D on binary logs from B (I've the --log-slave-updates
option enabled on all server).
For legacy issues, the envoirement use MySQL 5.0
No correct solution