A couple of days ago, I was thinking about what we need to
implement inside MySQL to support easier replication fail-over
(of an old master to a new master).
I came up with some preliminary ideas that I scetch below. If you
have any suggestions on how to solve these problems in a smarter
way, please write a comment to this blog entry.
PROBLEM 1: The fail-over infinite looping
problem
The scenario is that four servers A, B, C, and D (with server ids
1, 2, 3, and 4 respectively) replicate in a topology { A->B,
B->C, C->D, D->A }. Server A crashes. The DBA wants
slave B to connect to master D instead and continue with the
circular replication.
The problem is that events generated on server A that has been
replicated to B but not to C and D will replicate in the circle
forever.
The normal loop detection that MySQL has discards events that are
generated on the same server, but …
[Read more]