Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

MySQL replication

Name: Anonymous 2005-06-20 4:07

Anonymous might need to do dual-master replication (with MySQL's circular replication feature). Anybody can share his/her experience with this?

Anonymous read a solution for possible issues with AUTO_INCREMENT values (setting them really high in one of the server so they won't collide), but what if each server gets to execute the following exactly at the same time?

Server 1: UPDATE table SET col='X' WHERE col='B'
Server 2: UPDATE table SET col='Z' WHERE col='X'

If Anonymous is not mistaken, this would be executed in reverse order by each server and would end up with different data in the table. Any light on this?

Name: Anonymous 2005-06-20 4:08

Er, forgot to say, thanks in advance; Anonymous is very thankful ^_^;

Name: Anonymous 2005-06-29 10:47

I guess few Anonymous ever did replication in MySQL

Name: Anonymous 2005-07-01 0:20 (sage)

not only you're altering different rows in your example but X != Z, so tell me one reason why the data in tables should remain the same after such updates ^^;

Name: Anonymous 2005-07-02 12:47

The problem is each server runs these queries in reverse order, if you're doing circular replication and I'm not mistaken. Server 1 will rename 'B' rows to 'X', while server 2 is renaming 'X' rows to 'Z'. Then they'll send their operation to the other, and server 1 renames to 'Z' the 'X' formerly 'B' rows it just renamed, while server 2 doesn't, because it renames 'B' to 'X' after having taken care of the 'X's that existed before all this.

If this gets confusing, Anonymous can post a more detailed, graphical explanation.

Don't change these.
Name: Email:
Entire Thread Thread List