Bug #9234 | Relay_Master_Log_File not updated when master is slave of itself | ||
---|---|---|---|
Submitted: | 16 Mar 2005 23:20 | Modified: | 18 Dec 2014 21:20 |
Reporter: | Jeremy Tinley | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S4 (Feature request) |
Version: | 4.0.20 | OS: | Linux (Redhat AS4) |
Assigned to: | Mats Kindahl | CPU Architecture: | Any |
[16 Mar 2005 23:20]
Jeremy Tinley
[17 Mar 2005 15:38]
Jeremy Tinley
Here's a little background on why we have a master database be a slave of itself. We have a primary and failover master (we'll call them A and B). The active master is reachable via a virtual IP that floats between the two. We have a series of database slaves that read from the current primary via the virtual IP. When a failover occurs, a shared volume containing the binary logs is switched to the other server. In order to sync B with the A, B must be a slave of A. When a failover occurs, A goes down and B assumes the master role. When A returns to service, it must be a slave of B to catch any updates that happened while it was unavailable. This is done automatically using heartbeat. The problem however, is that A does not know where to start replicating from without either a) clearing all the binary logs and starting from the beginning or b) keeping track of where it left off. The easiest way to keep track of where it left off is to make the master a slave of itself. This will ensure that the local master.info file is at the very last position before A went down. When it comes back up, the IO thread begins reading from the next file, the one that B just created.
[18 Dec 2014 21:20]
Jeremy Tinley
Closing. This is obsolete and irrelevant now.