1

I'm using pt-table-checksum version 2.1.4 for checking my master-slave set up. In the case when I forget to set up the right privileges on the slave, it writes an error to stderr like this:

# pt-table-checksum -d employees
Cannot connect to h=node03.mydomain.local                                 <== error
            TS ERRORS  DIFFS     ROWS  CHUNKS SKIPPED    TIME TABLE
10-04T15:33:33      0      0        9       1       0   0.014 employees.departments
[...]

However, the exit status of it is 0.

# echo $?
0

The number differences it will find is always zero, as it has nothing to compare against. And yes, documentation says to exit with status 0 if no differences or errors have been reported. But this does not make sense in most cases.

Is there a way to make pt-table-checksum not failing silently and reporting this as a general failure? Should I file a bug or is this configurable?

It proves to be confusing to more users, for example in this question: "pt-table-checksum help required".

1 Answer 1

1

pt-table-checksum runs on the master primarily, but as binary logging on MySQL is statement based, the actual calculation statements are being executed on the slave as well. One should then run pt-table-checksum on the slave to check and compare the checksums it can't access the slave from the master. Add the --replicate-check-only option to have it only check for differences based on the checksums already present in the checksums table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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