Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up master-master replication of 2 servers and in one of the tables I use REPLACE INTO to update the data in a table. Is it possible that a link between the 2 servers goes down, then server 1 updates a certain row, a few seconds later the server 2 updates the same row and when the two get connected back, the more up-to-data on server 2 is overwritten by the data from server 1?

share|improve this question

You've just discovered why master-master "replication" setups with MySQL are not so much of a great idea. Worse yet, your changed data from server 2 is propagated to server 1 as well, so they will end up with different (swapped) data within the two replicas of your tables for good and never know about it. Except in the case where you are altering one of the columns you filter your query by, where replication will break (stop with an error) due to differencies in column count affected by the query (which is recorded and checked for by the MySQL replicator implementation).

You should use MySQL cluster if you want to pursue this kind of setup with MySQL - it has means to resolve this kind of conflicts coherently. In contrast to "free" MySQL setups, licensing is going to cost you $$$.

share|improve this answer
Thanks, I've actually tried that setup and can confirm that the changes got swapped in the end. – Fluffy Apr 21 '12 at 8:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.