pt-online-schema-change should set session-level lock_wait_timeout for schema change operations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Version: pt-online-
Mysqld version: Percona-
Description:
When running pt-online-
* creating triggers on source table that is being altered
* renaming the "new" and "old" tables after a schema change is complete
This is further exacerbated by the default setting of "lock_wait_timeout" being set to "31536000" (365 days). Since pt-online-
Steps to reproduce:
1) Create a test table:
CREATE DATABASE test;
CREATE TABLE test2 (
id int(10) unsigned not null auto_increment,
c int(11) default null,
primary key (id)
) engine=innodb auto_increment=
2) Start a transaction that will take a read lock on this table:
BEGIN;
USE test;
SELECT * FROM test2 LIMIT 1;
3) In a different window, begin concurrent inserts (these will insert and complete without being blocked by the transaction above):
for i in {1..1000}; do usleep 500; (mysql -S /var/lib/
4) In a third window, while the concurrent inserts from above are running:
pt-online-
5) If you check the processlist on the server, you'll see inserts from step 2 stacking up behind the "CREATE TRIGGER" operation being performed by pt-online-
Yes, the default value of lock_wait_timeout is 365 days.
However, to set any session level variable you can use --set-vars www.percona. com/doc/ percona- toolkit/ 2.1/pt- online- schema- change. html )
(http://
Since lock_wait_timeout is also a session level variable, it
should do.