pt-table-checksum doesn't warn if no slaves are found
Bug #1087804 reported by
Daniel Nichter
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
pt-table-checksum doesn't warn if no slaves are found. For PXC clusters it does, but not for regular replication. This can lead to misleading results because a master is always consistent with itself. The tool should really at least warn if no slaves are found so the user knows that --recursion-method (i.e. auto-slave finding) failed and the results aren't really useful.
Related branches
lp:~percona-toolkit-dev/percona-toolkit/fix-ptc-slave-warn-bug-1087804
- Daniel Nichter: Approve
-
Diff: 107 lines (+68/-2)2 files modifiedbin/pt-table-checksum (+16/-0)
t/pt-table-checksum/basics.t (+52/-2)
Changed in percona-toolkit: | |
assignee: | nobody → Daniel Nichter (daniel-nichter) |
status: | Triaged → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
If no slaves are found, and recursion-method is not "none", and --quiet < 2, then this warning is printed and exit status is non-zero:
"Diffs cannot be detected because no slaves were found. Please read the --recursion-method documentation for information."
I thought about making the tool die at this point so it doesn't do a bunch of useless work, but it could happen that slaves do exist but aren't found, so checksums do replicate, then the user can --replicate- check-only later to see if there are diffs.
I think non-zero exit status is correct because some users may be checking it rather than the output, in which case this will indicate that despite zero diffs, there was a problem that explains why there are zero diffs.