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

What does pt-table-checksum actually *DO*?

brainwavesurferbrainwavesurfer EntrantInactive User Role Beginner
Dear all, I've been looking at some way to reconcile and make sure that my slave matches the master exactly (at least disregarding the database "foam" where the activity is occurring too fast to stand still).

By this statement, I'm asking about the operation of the program, i know it creates a table in the mysql schema, and writes to it. but, what is it doing on the slave, only reading, and then writing the data on the master's table?

Thanks!

Sincerely, Jim Agnew

Comments

  • jriverajrivera Percona Support Engineer Percona Staff Role
    Basically pt-tc runs checksum on all tables on the master and on each of its slave. It first runs a a checksum on the master tables, once its done with the master it will run a checksum on each slave one at a time. If there are any differences on the slave, pt-tc will modify this_cnt and this_crc columns on the slave server. After running checksums on all slaves it will print out a report on the differences/errors etc.

    You can then run a query on the checksum_table to determine which tables have diverged from the master, you have to execute this query on each slave server.

    It does not modify any other table except the checksum_table which is percona.checksums by default unless specified explicitly.

    So you can execute pt-table-checksum at a regular basis (eg every night or once a week), and then use something like Percona Monitoring plugins to run pmp-pt-table-checksum on each slave server to report/alert if there are any slave that have drifted.

    Lastly, the best way to understand the tool is by using it and/or running it with PTDEBUG=1.
  • brainwavesurferbrainwavesurfer Entrant Inactive User Role Beginner
    Dear jrivera,

    Thank you very much!!!

    Jim
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.