Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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