pt-table-checksums diff_rows does not update its current maximum
General
Escalation
General
Escalation
Description
Environment
None
AFFECTED CS IDs
CS0051957
Activity
Show:
Details
Details
Assignee
Unassigned
UnassignedReporter

Priority
Components
Affects versions
Needs QA
Yes
Smart Checklist
Open Smart Checklist
Smart Checklist

Open Smart Checklist
Created December 29, 2024 at 1:38 PM
Updated December 29, 2024 at 1:38 PM
See https://github.com/percona/percona-toolkit/blob/3.x/bin/pt-table-checksum#L11614-L11619
my $max_cnt_diff=0; for my $diff (@$diffs) { if (abs($diff->{cnt_diff}) > $max_cnt_diff) { $tbl->{checksum_results}->{max_rows_cnt_diff} = abs($diff->{cnt_diff}); } }
It relies on
max_cnt_diff
, but does not update it, so it keep 0Adding a log
11620 my $max_cnt_diff=0; 11621 for my $diff (@$diffs) { 11622 PTDEBUG && _d('comparing max diffs', $max_cnt_diff, abs($diff->{cnt_diff})); 11623 if (abs($diff->{cnt_diff}) > $max_cnt_diff) { 11624 $tbl->{checksum_results}->{max_rows_cnt_diff} = abs($diff->{cnt_diff}); 11625 } 11626 } 11627 };
shows
# pt_table_checksum:11622 1792377 comparing max diffs 0 9 # pt_table_checksum:11622 1792377 comparing max diffs 0 65 # pt_table_checksum:11622 1792377 comparing max diffs 0 39
so the result end up showing the latest diff
Checking if all tables can be checksummed ... Starting checksum ... TS ERRORS DIFFS ROWS DIFF_ROWS CHUNKS SKIPPED TIME TABLE 12-29T14:26:43 0 3 9887 39 5 0 1.758 test.sbtest1