pt-online-schema-change Threads_running check causes premature bailout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Command:
pt-online-
Tool version:
Percona Toolkit 2.1.1
MySQL version, all servers:
5.5.12-log
OS:
SunOS 5.10 Generic_141415-07 i86pc i386 i86pc
Solaris 10
Typical query during execution:
Sending data INSERT LOW_PRIORITY IGNORE INTO `v4net`
Tool output:
...
Copying `v4net`.`files`: 94% 00:44 remain
Copying `v4net`.`files`: 96% 00:27 remain
Replica lag is 9 seconds on ned. Waiting.
Copying `v4net`.`files`: 97% 00:18 remain
Copying `v4net`.`files`: 98% 00:10 remain
Copying `v4net`.`files`: 99% 00:05 remain
Replica lag is 15 seconds on ned. Waiting.
Error copying rows from `v4net`.`files` to `v4net`
Dropping triggers...
Dropped triggers OK.
Dropping new table...
Dropped new table OK.
`v4net`.`files` was not altered.
Note also, the tool incorrectly estimates the number of rows that will be copied (Copying approximately 52556 when the actual number is 189799.
The tool worked correctly on a copy of the same table on one of our replicants, but failed twice on the attempts to run this on the master.
We have a master and two replicants. We use 'mixed' replication (mostly statement-based).
According to cacti graphs, running threads stayed below 10 on the master while the schema change operation was in progress.
The sample interval for Cacti is 5 minutes, so it is possible that running threads could spike without us knowing... however load average was below 1 for the duration of the operation.
tags: | added: pt-online-schema-change |
This is unlikely to be a bug; Threads_running=52 is unlikely to be incorrect. It's much more likely that you simply didn't see the spike. Please try running the tool again while also running something like "mysqladmin extended-status -i1" or watching the server with innotop set to a 1-second refresh interval and write back if you can confirm that Threads_running doesn't increase at the moment the tool claims it does.
The estimate comes from EXPLAIN, so that's just an artifact of MySQL's inexact statistics.