wasylni / pt_online_schema_change_pause

pt-online-schema-change pause before swap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pt-online-schema-change plugin written in Perl.

Plugin when executed with your pt-online-schema-change command will pause in the last stage of execution, untill file ./pt_schema_change_wait.txt is deleted.

#####How to run:

just add --plugin /path/to/fis_pt_online_schema_change_plugin.pl to your pt-online-schema-change command

#####what will it do to your pt-online-schema-change run:

it will create plain text file in ./pt_schema_change_wait.txt your pt-online-schema-change command should run as usual until very last step, it will pause before_swap_tables is executed.

PLEASE MAKE SURE THAT YOUR DATA IS IN SYNC BEFORE YOU DELETE ./pt_schema_change_wait.txt!

pt-online-schema-change documentation

#####example:

pt-online-schema-change --execute --plugin /path/to/pt_online_schema_change_plugin.pl --password=YOUR_DB_PASSWORD --user=YOUR_DB_USER --chunk-time=1 --nodrop-old-table --alter "add column foo int(11) default null, add column foo2 int(11) default null, add column foo3 int(11) default null, add column foo4 int(11) default null" D=employees,t=employees,h=127.0.0.1 --alter-foreign-keys-method "auto"


btw, --pause-file option in the latest pt-online-schema-change build (2.2.20) will do similar thing. However this option will only create copy of the table, with new schema and only move data when file is deleted.

About

pt-online-schema-change pause before swap

License:GNU General Public License v2.0


Languages

Language:Perl 100.0%