tencent cloud

Performing Instant add column and Online DDL Operations on a Table in Succession Causes a crash
Last updated: 2025-12-04 15:37:13
Performing Instant add column and Online DDL Operations on a Table in Succession Causes a crash
Last updated: 2025-12-04 15:37:13

Problem

Performing Instant add column and Online DDL consecutively on a table causes a crash.

Problem Triggering Scenarios

Performing Instant DDL on a table followed consecutively by Online DDL operations such as OPTIMIZE TABLE or ALTER TABLE .. ADD PRIMARY KEY may cause a program crash due to improper code handling (failing to use the INSTANT algorithm for column addition or the REDUNDANT format).

The Kernel Version Involved in the Issue

MySQL 8.0 20221221 and earlier versions.

Fixed Kernel Version

MySQL 8.0 20241005.

Inspection Method

You can refer to the following commands to check for tables with potential risks.
select replace(name, '/', '.') as 'table_schema.table_name' from information_schema.innodb_tables where TOTAL_ROW_VERSIONS!=0 or INSTANT_COLS!=0;

Fixing Method

1. Upgrade the kernel version to MySQL 8.0 20241005. For the operation method, see upgrade the minor kernel version.
2. After upgrading the kernel version, rebuild and repair the corrupted tables. This can be repaired via alter table xx engine = innodb;. To avoid business impact caused by table locking, it is recommended to perform the repair during off-peak hours using tools such as pt-osc.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback