pt-table-checksum has high likelyhood to skip a table when row count is around chunk-size * chunk-size-limit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Frank Cizmich |
Bug Description
pt-table-checksum decides whether a table can be checksummed in one chunk based on:
estimated rows <= --chunk-size * --chunk-size-limit
This gives no allowance for inaccuracy of row estimates when the table size is around the number of --chunk-size * --chunk-size-limit. For example, with the default setting of --chunk-size=1000, --chunk-
One fix is to remove this one-chunk logic and always use --chunk-size or heuristic to do chunking.
This is related to support issue #43754.
Related branches
- Daniel Nichter: Needs Information
-
Diff: 81 lines (+47/-1)3 files modifiedbin/pt-table-checksum (+1/-1)
t/pt-table-checksum/basics.t (+37/-0)
t/pt-table-checksum/samples/create_skip_table.sql (+9/-0)
summary: |
- pt-table-checksum has high likelyhood to skip a table when rows around - chunk-size * chunk-size-limit + pt-table-checksum has high likelyhood to skip a table when row count is + around chunk-size * chunk-size-limit |
tags: | added: i43754 |
tags: | added: pt-table-checksum |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Frank Cizmich (frank-cizmich) |
milestone: | none → 2.2.14 |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
milestone: | 2.2.14 → none |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
status: | Fix Released → In Progress |
Changed in percona-toolkit: | |
milestone: | none → 2.3.1 |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Won't Fix → In Progress |
milestone: | none → 2.2.17 |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Able to verified with PS 5.6 and pt-table-checksum 2.2.11
Test case is very simple. Just create one table in master-slave environment. like test and keep value < 2000 on master and > 2000 on slave.
On master:
mysql> select count(*) from test;
+----------+
| count(*) |
+----------+
| 1948 |
+----------+
1 row in set (0.01 sec)
On slave:
mysql> select count(*) from test;
+----------+
| count(*) |
+----------+
| 2048 |
+----------+
1 row in set (0.00 sec)
Then run checksum with --chunk-size option,
nilnandan@ Dell-XPS: ~$ pt-table-checksum --chunk-size=1000 --user=root --password=msandbox --socket= /tmp/mysql_ sandbox20886. sock --recursion-method dsn=D=percona, t=dsns binlog_ index zone_leap_ second zone_name zone_transition zone_transition _type pt-table- checksum line 6417.
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
11-12T14:21:48 0 0 0 1 0 0.041 mysql.columns_priv
11-12T14:21:48 0 0 0 1 0 0.032 mysql.db
11-12T14:21:48 0 0 0 1 0 0.037 mysql.event
11-12T14:21:48 0 0 0 1 0 0.035 mysql.func
11-12T14:21:48 0 0 40 1 0 0.031 mysql.help_category
11-12T14:21:48 0 0 485 1 0 0.033 mysql.help_keyword
11-12T14:21:48 0 0 1090 1 0 0.037 mysql.help_relation
11-12T14:21:49 0 0 533 1 0 0.042 mysql.help_topic
11-12T14:21:49 0 0 0 1 0 0.030 mysql.ndb_
11-12T14:21:49 0 0 0 1 0 0.035 mysql.plugin
11-12T14:21:49 0 0 0 1 0 0.032 mysql.proc
11-12T14:21:49 0 0 0 1 0 0.034 mysql.procs_priv
11-12T14:21:49 0 0 2 1 0 0.039 mysql.proxies_priv
11-12T14:21:49 0 0 0 1 0 0.027 mysql.servers
11-12T14:21:49 0 0 0 1 0 0.031 mysql.tables_priv
11-12T14:21:49 0 0 0 1 0 0.036 mysql.time_zone
11-12T14:21:49 0 0 0 1 0 0.032 mysql.time_
11-12T14:21:49 0 0 0 1 0 0.036 mysql.time_
11-12T14:21:49 0 0 0 1 0 0.021 mysql.time_
11-12T14:21:49 0 0 0 1 0 0.031 mysql.time_
11-12T14:21:49 0 0 8 1 0 0.022 mysql.user
11-12T14:21:49 Skipping table nil.test because on the master it would be checksummed in one chunk but on these replicas it has too many rows:
2031 rows on Dell-XPS
The current chunk size limit is 2000 rows (chunk size=1000 * chunk size limit=2.0).
11-12T14:21:49 0 0 1 1 0 0.026 percona.dsns
11-12T14:21:49 0 0 1 1 0 0.040 test.nil
11-12T14:21:49 Cannot checksum table test.nil_test: There is no good index and the table is oversized. at /usr/bin/
nilnandan@ Dell-XPS: ~$