I'm try to use pt-table-checksum tool. I have Master/Slave tables, and I add some rows to the slave to check it.

pt-table-checksum --ignore-databases mysql S=/tmp/5.6.22_3306_Master/data/mysql.sock --user=SlaveUser --password=1234

produce this result:

07-21T16:47:35      0      0        8       1       0   0.008 test.Countries
07-21T16:47:35      0      0        0       1       0   0.006 test.Persons

When I run this query (SELECT * FROM percona.checksums WHERE db not like 'mysql';) on the slave I can see the difference:

enter image description here

How I can see the right result and the diff with pt-table-checksum?



Manual states it clearly:

If you wish, you can query the checksum tables manually to get a report of which tables and chunks have differences from the master. The following query will report every database and table with differences, along with a summary of the number of chunks and rows possibly affected:

SELECT db, tbl, SUM(this_cnt) AS total_rows, COUNT(*) AS chunks
FROM percona.checksums
 master_cnt <> this_cnt
 OR master_crc <> this_crc
 OR ISNULL(master_crc) <> ISNULL(this_crc))
GROUP BY db, tbl;

The table referenced in that query is the checksum table, where the checksums are stored. Each row in the table contains the checksum of one chunk of data from some table in the server.

To get the actual differences, you'd need to run pt-table-sync --print and determine the changes by the SQL queries it generates.

  • I saw on the manual. But yet, shouldn't I see difference on the output table? – ElazarG Jul 27 '16 at 7:08
  • yes but with the above query you'll get the summary of chunks and estimated rows affected. – jerichorivera Jul 27 '16 at 8:41

Your Answer

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

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