pt-table-checksum fails if a database is dropped while the tool is running
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Carlos Salguero |
Bug Description
If a database is dropped while pt-table-checksum is running, the tool exists with a fatal error:
$ pt-table-checksum --no-check-
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
01-23T16:40:10 0 0 0 1 0 0.012 mysql.columns_priv
<...output trimmed>
DBD::mysql::db selectall_arrayref failed: Unknown database 'pttctest98' [for Statement "SHOW /*!50002 FULL*/ TABLES FROM `pttctest98`"] at /usr/bin/
$ echo $?
255
How to reproduce:
In one session in the master server run the following:
for i in `seq 1000`; do
mysql -e "CREATE SCHEMA pttctest$i";
mysql -e "DROP SCHEMA pttctest$(($i-1))";
done;
In another one (after the previous command is run), run the pt-table-checksum. The tool will exit with an error like seen above.
Suggested fix:
Check if the database exists before running the SHOW FULL TABLES FROM ... command.
Changed in percona-toolkit: | |
assignee: | nobody → Carlos Salguero (carlos-salguero) |
Changed in percona-toolkit: | |
status: | New → Confirmed |
tags: | added: pt105 |
Changed in percona-toolkit: | |
importance: | Undecided → Medium |
status: | Confirmed → In Progress |
milestone: | none → 3.0.2 |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Sorry, I forgot to mention versions.
MySQL 5.7.17, and pt-table-checksum 2.2.19