I have a rather large MySQL database with a handful of replicating slaves. Recently I ran the percona toolkit checksum and found a couple of tables out of sync. What is the best way to get them back in sync while minimizing any downtime of the master db?

I looked at this method but am unsure about the warnings: http://scale-out-blog.blogspot.com/2011/01/fixing-replication-with-replication.html

Similarly I'm reluctant to try the percona toolkit pt-table-sync for fixing this, on the live site. One of the slaves is remote and NAT'd so it seems that the pt tools aren't able to communicate as designed.

My thought is to do this:

1) Lock tables on the master
2) Stop slave replication on all the slaves
3) mysqldump one table in question - should take about 20 seconds or less
4) Unlock tables on master
5) import dumped table on slaves
6) start slave replication

1) Will this get the slaves back in sync?
2) Is there a better way?

  • pt-table-sync never writes to a slave. so, what's a problem with NAT? – akuzminsky Aug 7 '14 at 17:53
  • 1
    ah, it has to read data from a slave to compare. Nevermind. – akuzminsky Aug 7 '14 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.