pt-table-checksum reports wrong number of DIFFS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
High
|
Daniel Nichter |
Bug Description
Due to this code:
# Check each slave for checksum diffs.
foreach my $slave ( @$slaves ) {
eval {
}
};
Only the last slave's number of diffs is reported for the table. So with master --> slave1 --> slave2, if slave1 has 2 diffs (in 2 different chunks) but slave2 only has 1, the tool will report 1 for DIFFS for the table. Solution: report the max(diffs) for all slaves for each table, i.e. 2 in this case.
As a reminder, from the tool's docs:
"""
=item DIFFS
The number of chunks that differ from the master on one or more replicas.
"""
So 2 is the correct number to report because, all in all, 2 chunks do differ, not just 1.
Related branches
- Brian Fraser (community): Approve
- Daniel Nichter: Approve
-
Diff: 126 lines (+65/-6)3 files modifiedbin/pt-table-checksum (+9/-2)
t/pt-table-checksum/bugs.t (+46/-4)
t/pt-table-checksum/samples/a-z.sql (+10/-0)
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
2nd problem:
"""
brian: If slave1 reported two chunks with diffs, and slave2 reported one chunk with a diff, it doesn't mean that the differing chunk in slave2 is one of the chunks differing in slave1
"""
So if chunk# 5 and #7 on slave1 differ, but chunk# 10 on slave2 differs, too, then that's actually 3 chunks that differ, not just 2.