|
Saravanan |
at Mar 31, 2009 at 9:42 pm
|
⇧ |
| |
Hi,
There are two types of logging in replication. Binary log and Relay log. Binary log is the log of update statements the server updated. The second one is log that is updates received from other server.
For example server A will not read the binary logs it updates and it will write in the relay logs that it reads from server B.
In Master to Master setup don't enable log_slave_updates.
Thanks,Saravanan
--- On Wed, 4/1/09, Mats Kindahl wrote:
From: Mats Kindahl <
mats@sun.com>
Subject: Re: Master to master replication
To:
database100@yahoo.comCc:
replication@lists.mysql.comDate: Wednesday, April 1, 2009, 3:59 AM
Database System wrote:
Hi,
On a master to master replication, if a table doesn't have a auto_increment column, how the server(s) prevents update statement from executing twice on same server.
For example, one update is done on server A, and another update is done on server B. But these two update statements are on both binary logs of server A and server B. When server A reads binary log from server B to replicate, two update statement are in binary log, how server A only execute one update done on server B and ignore another one that was done on server A?
Thanks,
Lisa
Hi Lisa,
Each server have to have a server id assigned, so statements executed on A will
be tagged with the server id of server A (and the same for B). When A then reads
an event (statement) from itself, it will just skip that event and move on to
the next one.
Best wishes,
Mats Kindahl