This feature makes the slave IO thread maintain a copy of the master’s binlog as it writes the relay log. By copy, we mean that the file has the same name and same contents (and offsets). When this is done, slave can transparently failover between replication proxy slaves as long as the proxies all mirror the binlog.
Note: When this is first enabled, the slave must download all of the current binlog. This can take some time. New events are not appended to the relay log until this has finished.
This patch was introduced in patchset d7.
Google (Mark Callaghan), updates and fixes by Percona and Open Query.
- rpl_mirror_binlog_enabled – Enable binlog mirroring (default: disabled).
- sync_mirror_binlog – Equivalent to sync_binlog option but for the mirror binlog, sync the mirrored binlog to disk after every #th event (#=0 (default) does no sync. Syncing slows things down).
- MAKE MASTER
[, INDEX=<log_file.index>] [WITH BINLOG]
– This command enables the use of a specific server-id and binlog on a slave without restarting mysqld: make the current database a primary and starts binlog logging for all updates. When the WITH BINLOG option is used, old binlogs will be kept after MAKE MASTER command.
MySQL replication is great. It is efficient, stable and easy to use. Unfortunately, it is not easy to use for hierarchical replication. The most important replication state on a slave is the name and offset for the file on the server from which it copies replication events.
When hierarchical replication is used, that state cannot be transferred without translation. For example, suppose there is one master, two slaves that replicate from the master and generate a binlog, these two are the replication proxy slaves. There are also many slaves that replicate from the two replication proxy slaves. If one of the replication proxy slaves fails, the slaves that replicated from the proxy cannot transparently failover to the other replication proxy. The binlogs written by the proxies might not have the same names, and replication events stored at the same offsets are not the same.