Catching up on some articles on the
Planet MySQL feed, I just read
the post by Dathan on how to promote a slave to be master by using
MASTER_POS_WAIT(). The
MASTER_POS_WAIT() is an excellent function that allows you to wait until the slave reaches a point
at or after the given binlog position. Observe that after the statement issuing a
MASTER_POS_WAIT() returns, the slave threads are still running, so this means that even if a
STOP SLAVE is issued immediately after the statement with
MASTER_POS_WAIT(), it is bound to move a little more before actually stopping. For Dathan's situation, this is not necessary, but wouldn't it be great if you could stop a slave at
[Read more...]