My favorites | Sign in
Google
                
Search
for
Updated Aug 19, 2008 by mdcallag
MirroredBinlogs  
Mirrored Binlogs

Note

This is only in the V1 patch. It has been removed from all other patches. GlobalTransactionIds should be used instead of it.

Introduction

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.

Notes

We have modified the slave IO thread to maintain a copy of the master's binlog as it writes the relay log. By copy, I mean that the file has the same name and same contents. When this is done, slave can transparently failover between replication proxy slaves as long as the proxies all mirror the binlog.

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.

Parameters:


Comment by bhansali...@yahoo.com, Nov 02, 2008

hi, Has the GlobalTransactionIds patch been tested for version 5.0.62 or 5.0.67. Is it available for public as a seperate patch ?

thanks Amit

Comment by mysqldavid, Jan 28, 2009

Can you provide a more detailed description of how the mirrored binlogs works? Will the current binlog and position on the slave be identical to the current binlog and position of its master? I discovered that initially binlog positions will be identical. Then the position on the slave will be different as soon as I "stop slave" and "start slave".

mysql> show global variables like 'rpl_mirror%'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | rpl_mirror_binlog_enabled | ON | +---------------------------+-------+ 1 row in set (0.00 sec)

mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do?_DB | Binlog_Ignore?_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000003 | 98 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)

mysql> stop slave; Query OK, 0 rows affected (0.00 sec)

mysql> start slave; Query OK, 0 rows affected (0.00 sec)

mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do?_DB | Binlog_Ignore?_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000003 | 192 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)

I have rpl_mirror_binlog_enabled, sync_mirror_binlog, and log-bin-index enabled on both master and slave.


Sign in to add a comment