pt-table-checksum's --float-precision does not work for very small / large values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Hello,
we use pt-table-checksum for a fairly large database containing measured values stored as DOUBLE. For very large or small values the ROUND() MySQL function used by --float-precision does not work as expected.
E.g. on the master it maps very small values to "0.0", while on the slave it maps them to "-0.0" (resulting in a different crc32). Or for large values, e.g. on the master and slave the significant digits of the mantissa are different after ROUND().
We have a patch that introduces a new command-line option to activate a different rounding algorithm that solves both problems. However, it is slower than the simple ROUND(), for that reason and backwards-
IF($result = 0, 0, SIGN($result) * ROUND(LOG2(
Would you be willing to accept such a patch in general? On which branch should it be based? If there is a chance to get it integrated upstream, we can provide concrete examples and further explanation.
Regards,
Johannes Weißl and Sebastian Egner
Related branches
- Percona Toolkit developers: Pending requested
-
Diff: 116 lines (+49/-4)2 files modifiedbin/pt-table-checksum (+24/-2)
bin/pt-table-sync (+25/-2)
Hello Johannes,
Yes it's possible we could include this patch or change how --float-precision works. You can branch https:/ /code.launchpad .net/~percona- toolkit- dev/percona- toolkit/ 2.2
See a concrete example would help. If the new algo is only a little slower but fixes a common problem, it's probably worth the tradeoff.