Diagnostic step 1
Identify the exact connection holding the MDL on the primary: SELECT * FROM performance_schema.metadata_locks and SHOW PROCESSLIST; note connection id.
Generated Oct 19, 2026, 9:33:36 AM
Identify the exact connection holding the MDL on the primary: SELECT * FROM performance_schema.metadata_locks and SHOW PROCESSLIST; note connection id.
If the ALTER was accidental or can be interrupted, coordinate with the app team and KILL the ALTER connection on primary; verify table integrity after termination and check binary log position.
On replicas: STOP SLAVE SQL_THREAD, inspect relay log position and pending event for the blocked table; do not skip errors blindly.
If ALTER must complete, schedule it for a maintenance window and use pt-online-schema-change or gh-ost to avoid long MDL holds.
If replication already diverged or you cannot safely kill DDL, rebuild replica from a fresh backup taken after primary is in the desired schema state and resume replication.