How do I perform crash recovery in a MySQL/InnoDB Master-Slave asynchronous replication setup?
Specifically:
If a slave crashes, how do I make it syncs up with the master after I bring it back up?
If the master crashes, a slave will become the master. How do I make the new master syncs up with other slaves? And when the original master is brought back up, how do I sync it with the new master?
Because replication is async, a transaction that has been committed to the master may not be able to leave the master before the crash happens. So there could be inconsistency between the original master and slaves, one of which will become the new master.
Likewise, the slave that are promoted to become the new master may not have the most up-to-date transactions among all the slaves. So the new master could be "behind" one of its slaves.
How do I resolve all these potential inconsistencies?
Any tools that help with these tasks?
Thanks.