I have a dual master-slave replication (server1 is master AND slave of server2).

After a problem with server1, the replication broke. After some skipped logs the replication came back to life. Then I ran a checksum and there was one table with DIFFs:

| 09-25T21:09:39 | 0 | 2   |5447202 | 181  |0      | 967.269|db1.myTable      

I don't want to do a simple table sync from server2 to 1 because I'm afraid there might be data in server1 that it isn't in server2.

So, is there a way to make a merge between tables in a master-slave replication?

1 Answer 1


You can use pt-table-sync with --verbose to generate the differential sql and verify the data from there. Whichever version you feel is correct you may choose to keep.

I'm not aware of any tool which will merge, as such what will be the merge condition upon conflicts?

Writing on both nodes in master-master can cause bad bad data! I'd try to avoid that.

  • I'd like to merge and in case of conflict I would use server2. I thought the whole purpose of master-master was to be able to write on both nodes, since if you arent't going to write in one of them you could use master-slave.
    – carla
    Oct 13, 2015 at 15:32
  • They can be used as active-passive (standby) roles but again that's another topic. For now I'd suggest to generate sql from pt-table-sync with --verbose (no --execute) and review them for differences. You might like to load them in temp tables to manually merge... I'd be enlighten if someone else can provide a better "merge" idea.
    – mysql_user
    Oct 13, 2015 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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