Before MySQL 8.0, DDL was not crash-safe. There were three main problems:
-
The metadata in the server layer and the metadata/data in InnoDB could become inconsistent.
The server-layer metadata was stored in files — for example, table definitions were kept in
.frmfiles — while InnoDB kept its own copy of the metadata in its tables. A crash could leave the server-layer metadata inconsistent with InnoDB’s metadata or even with the table data. For example, the server layer still had the table’s.frmfile and believed the table existed, but InnoDB’s.ibddata file was gone, so InnoDB believed the table did not exist. - InnoDB’s metadata and data could become inconsistent.
-
The binlog and the data could become inconsistent.
For example, after a crash and …