In this blog post we’ll discuss pt-online-schema-change, and
how to correctly use it.
Always use pt-osc?
Altering large tables can be still a problematic DBA task, even
now after we’ve improved Online DDL features in MySQL 5.6 and 5.7. Some
ALTER types are still not online, or sometimes just too expensive
to execute on busy production master.
So in some cases, we may want to apply an
first on slaves, taking them out of traffic pool one by one
and bringing them back after the
is done. In the end, we can promote one of the already
altered slaves to be new master, so that the downtime/maintenance
time is greatly minimized. The ex-master can be altered later,
without affecting production. Of course, this method works best
when the schema change is …[Read more]