1

I'm using pt-table-checksum and pt-table-sync to check for differences in my replicas. when I use pt-table-sync with the -print option, I can only see the master values.

How can I show the conflicting slave values as well? I want to see if I can find a pattern of which those diffs occur by.

RolandoMySQLDBA
  • 16,544
  • 3
  • 48
  • 84
SecondThought
  • 409
  • 1
  • 4
  • 11

1 Answers1

1

Using pt-table-sync with these options

  • --print
  • --sync-to-master

will report the SQL changes to execute on the Slave to make the Slave match the Master.

The Master is simply connected for comparison purposes.

The Percona Documenation on --print option says

Print queries that will resolve differences.

If you don’t trust pt-table-sync, or just want to see what it will do, this is a good way to be safe. These queries are valid SQL and you can run them yourself if you want to sync the tables manually.

For emphasis : Do not execute the output of --print AND --sync-to-master on a Master. Execute it on a Slave only.

If you are using Circular Replication, do this

echo "SET SQL_LOG_BIN = 0;" > ChangesToSlave.sql
pt-table-sync --print --sync-to-master ... >> ChangesToSlave.sql

then you can run ChangesToSlave.sql on a Slave.

RolandoMySQLDBA
  • 16,544
  • 3
  • 48
  • 84
  • Good answer, but it does not provide a real answer to the question: *What are the conflicting values of the row on the slave side?* What I did was looking in the checkums table `pt-table-checksum` created using a very small chunk size - this pointed me to a bunch of rows easy to spot the difference myself. It turned out to be a different timezone producing different `NOW()` values. – gertvdijk Dec 14 '12 at 22:16