From MySQL Online Alter to a CPU 100% Incident
Key point
This covers the process and incident encountered while attempting an **online alter** to add a new column to a large-scale MySQL table.
Details
The [Cookie Run: Ovenbreak] team needed to add a purchase_dt column and index to the purchase history table to implement a new feature. However, the table was extremely large, so a normal ALTER TABLE risked service disruption due to Table Lock.
The first alternative, MySQL's inplace algorithm, was discarded after testing revealed a Duplicate entry error, confirming a limitation stated in the official documentation.
As an alternative, they chose Percona Toolkit's pt-online-schema-change. This tool changes the schema without service interruption through a process of creating a new table, setting up triggers, copying data, and swapping the table.
The work proceeded in stages, verifying stability through replica testing in the Staging environment and a Dry run.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.