Question

I used pt-online-schema-change but the process died in the middle.

The script makes a copy of the original table with the name followed by "_new".

Since the process died in the middle, the table "_new" wasn't deleted and when I try to delete it my application crashes.

It seems whenever I alter the original table this _new table is also changed so if it is not found it crashes.

I would like to know how can I remove this _new table.

Was it helpful?

Solution

Like many other solutions designed for an almost lockless schema change, pt-online-schema-change works by creating triggers on your table and creating a _new table. As stated in the documentation:

Any modifications to data in the original tables during the copy will be reflected in the new table, because the tool creates triggers on the original table to update the corresponding rows in the new table

If this utility crashed, you might have to do the cleanup yourself. This might include:

  • Removing the triggers: have a look at the SHOW TRIGGERS syntax to see the ones pt-online-schema-change has just created;
  • Delete the _new table.
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top