Not the answer you need?
Register and ask your own question!

pt-table-sync usage with master-slave replication

antoniofernandezantoniofernandez EntrantCurrent User Role Beginner
Hi everybody,

I'm using pt-table-sync to try to synchronize a table between two hosts. I have executed this command (Passwords are clear because are hosts in lan environment - lab):
pt-table-sync h=,u=root,[email protected],P=3306,D=radius,t=radcheck h=,u=root,p=m1rr0r,P=3306,D=radius,t=radcheck --execute --replicate percona.checksums

This command's output shows a lot of querys (REPLACE INTO) but I would like to get differences between both only. So, what is wrong? Anybody can help me?

Thanks in advance.




  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner

    If master and slave servers are not sync then there are two different tools which you can use for make it sync.
    1. pt-table-checksum -- which will run the checksum and check integrity between master and slave servers. so will show you differences.
    2. pt-table-sync -- which will synchronize data between master-slave servers
  • antoniofernandezantoniofernandez Entrant Current User Role Beginner

    Thanks for your reply niljoshi.

    So, are these commands independent between them?
    And another question ... I have executed a pt-table-checksum and shows some differences between master and slave. My intention is to solve these differences, so, after that I have executed pt-table-sync. A second pt-table-checksum shows differences again. Is this normal? (Maybe yes, because is a replication environment, with some activity ...)

    In conclusion: How can be sure to that there are not differences between master and slave?

    Thanks in advance for your help and your advices.


  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner

    Yes, both are individual tool. If you see still differences after running pt-table-sync then there must be some issue with the process which you are following OR some bug....god knows. You can verify it by checking for which table you are getting differences and for that are you getting replace statements in pt-table-sync? provide which steps you are following with output.

    Though, its replication, pt-table-sync will not directly run those statements in slave...but it will run in slave. Thats why its replace not insert.
    please read above documentations for detailed information.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.