Bug #1757 Replication FAQ how to promote a slave to master may result in data out of sync
Submitted: 5 Nov 2003 9:15 Modified: 24 Nov 2003 12:14
Reporter: William Tam Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version: OS:
Assigned to: Paul DuBois CPU Architecture:Any

[5 Nov 2003 9:15] William Tam
Description:
The "how to setup redundancy/high availability" section of the Replication FAQ is incomplete when describing how to change a slave to a master and set the other slaves to point to it.  If you issue STOP SLAVE on the slaves without checking to see if they have executed all of the statements in the relay log, you risk getting your data out of sync when you do RESET MASTER on the slave promoted to master or when you do CHANGE MASTER TO on the slaves.  

How to repeat:
Have a lot of slow update/inserts going on when the master goes down and then start the slave-to-master promotion process described in the FAQ before all statements in the relay log have been completed.

Suggested fix:
Instead, the documentation should tell the user to issue STOP SLAVE IO_THREAD on all slaves; then check for "Has read all relay log" in the output of "mysqladmin proc".  When that returns true on all slaves, they can issue STOP SLAVE on all slaves including the slave being promoted to master, RESET MASTER on the promotee, then CHANGE MASTER TO and START SLAVE on the slaves.
[24 Nov 2003 12:14] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).