pt-table-checksum ignores --lock-wait-timeout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
Line 5940-5949:
$sql = 'SHOW SESSION VARIABLES LIKE "innodb_
PTDEBUG && _d($dbh, $sql);
my (undef, $lock_wait_timeout) = $dbh->selectrow
PTDEBUG && _d('innodb_
if ( ($lock_wait_timeout || 0) > $o->get(
$sql = 'SET SESSION innodb_
eval {
PTDEBUG && _d($dbh, $sql);
};
So if you set, --lock-wait-timeout to a value less than the current innodb_
If you want to use the existing innodb_
Related branches
- Daniel Nichter: Approve
-
Diff: 80 lines (+37/-26)1 file modifiedbin/pt-table-checksum (+37/-26)
tags: | added: pt-table-checksum |
summary: |
- pt-table-checksum v 2.0.3 ignores --lock-wait-timeout parameter + pt-table-checksum ignores --lock-wait-timeout |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
This code is very surprising to me. It should set the value of lock_wait_timeout to the value of the option regardless of the option's value, instead of using a hard-coded constant. It should also not do any greater-than comparison before the attempt to set the value. Instead, the greater-than comparison should be done in the error-handling code in case the attempt to set the value causes an error. The error should be displayed only if the value fails to be set and as a result is greater than what the user specified.
Furthermore, we need to get rid of the double-quotes in the SQL.
Finally, we need to document the error-if- failure- and-timeout- is-undesirably- large behavior.