pt-table-checksum doesn't test all hash functions

Bug #1059732 reported by Matthew B
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Brian Fraser

Bug Description

pt-table-checksum doesn't test all hash functions in available array and continues anyway on error.

To Test/Reproduce:
 Change line:
my @funcs = qw(CRC32 MD5 SHA1);
 To:
my @funcs = qw(CRC32A MD5 SHA1);

Run pt-t-c. The test for CRC32A will fail but script continues as if it has chosen bad function. Script will eventually exit on SQL error when master attempts to use bad function.

Additionally, the online-documentation implies that pt-t-c will check for "recommended" functions (MURMUR_HASH, FNV1A_64) and it does not.

The attached patch adds MURMUR_HASH, FNV1A_64 and FNV_64 to check list in preferred order over built-ins. The patch also continues evaluation of all functions until it finds one or dies with appropriate message.

Related branches

Revision history for this message
Matthew B (utdrmac) wrote :
tags: added: crash pt-table-checksum wrong-behavior
Changed in percona-toolkit:
status: New → Triaged
tags: added: chunking pt-table-checkum
removed: pt-table-checksum
tags: removed: wrong-behavior
Changed in percona-toolkit:
milestone: none → 2.1.6
importance: Undecided → Medium
tags: added: pt-table-checksum
removed: pt-table-checkum
Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
assignee: Daniel Nichter (daniel-nichter) → Brian Fraser (fraserbn)
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Triaged → In Progress
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Let's change

my @funcs = qw(CRC32 FNV1A_64 FNV_64 MD5 SHA1);

to

my @funcs = qw(CRC32 FNV1A_64 FNV_64 MURMUR_HASH MD5 SHA1);

Revision history for this message
Matthew B (utdrmac) wrote :

Well, we know that CRC32 will always work. So if we are checking in array order, the "preferred" functions will never get tested for.

It should be, IMO: qw(MURMUR_HASH FNV1A_64 FNV_64 CRC32 MD5 SHA1)

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Agreed, but for whatever reason the docs say that CRC32 is default, so we should not change that yet because I don't know what the consequences would be--perhaps nothing, but we try to avoid changing how tool internals work (unless something is broken) during stable releases (i.e. 2.1). For 2.2, though, we should definitely default to the best. Until then, and given that the UDFs are probably only rarely installed and when they are the user knows about it (because they probably installed them), then they can be specified still with --function.

Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: In Progress → Fix Committed
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-586

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.