pt-online-schema-change causes "ERROR 1146 (42S02): Table 'db._t_new' doesn't exist"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
High
|
Daniel Nichter |
Bug Description
In this failure case, pt-online-
During the cleanup phase, one of the triggers could not be dropped. pt-online-
jsnyder@test:~$ pt-online-
Altering `mydb`.`mytable`...
Creating new table...
Created new table mydb.__mytable_new OK.
Altering new table...
Altered `mydb`.
Creating triggers...
Created triggers OK.
Copying approximately 10000000 rows...
Copying `mydb`.`mytable`: 0% 01:59:54 remain
Copying `mydb`.`mytable`: 0% 01:50:40 remain
Dropping triggers...
Error dropping trigger: DBD::mysql::db do failed: Lock wait timeout exceeded; try restarting transaction at /usr/bin/
To try dropping the triggers again, execute:
DROP TRIGGER IF EXISTS `mydb`.
Dropping new table...
Dropped new table OK.
`mydb`.`mytable` was not altered.
Error copying rows from `mydb`.`mytable` to `mydb`.
Until the trigger was dropped, attempts to write to the original table resulted in the error:
Table 'mydb._
The simplest solution to me seems to be that if pt-online-
Related branches
- Daniel Nichter: Approve
-
Diff: 202 lines (+136/-9)3 files modifiedbin/pt-online-schema-change (+20/-9)
t/pt-online-schema-change/cleanup.t (+80/-0)
t/pt-online-schema-change/samples/plugins/make_drop_trigger_fail.pm (+36/-0)
tags: | added: i32429 |
Changed in percona-toolkit: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Daniel Nichter (daniel-nichter) |
tags: |
added: percona-32429 pt-online-schema-change removed: i32429 |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
tags: | added: risk |
summary: |
- pt-online-schema-change should not drop __mytable_new table if it was - unable to drop one or more triggers + pt-online-schema-change drops table __tbl_new even if DROP TRIGGER fails + causing "Table '__tbl_new' doesn't exist" errors |
summary: |
- pt-online-schema-change drops table __tbl_new even if DROP TRIGGER fails - causing "Table '__tbl_new' doesn't exist" errors + pt-online-schema-change drops table __tbl_new even if a DROP TRIGGER + fails causing "Table '__tbl_new' doesn't exist" errors |
Changed in percona-toolkit: | |
milestone: | none → 2.2.3 |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
milestone: | 2.2.4 → 2.2.3 |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
I confirm this too:
"""
mysql> insert into t values (null, 'x', now());
Query OK, 1 row affected, 2 warnings (0.00 sec)
mysql> drop table _t_new;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t values (null, 'y', now());
ERROR 1146 (42S02): Table 'pt_osc._t_new' doesn't exist
"""