MySQL InnoDB Online DDL (ALGORITHM=INSTANT / INPLACE, LOCK=NONE)
MySQL silently falls back to a write-blocking ALGORITHM=COPY table rebuild if an operation is unsupported online, unless you explicitly declare ALGORITHM and LOCK=NONE.
Engine: MySQL
Risk: CAUTION
Lock: Implicit fallback to COPY vs explicit INSTANT / INPLACE, LOCK=NONE
Blocking Pattern (Avoid in Production)
ALTER TABLE shipments MODIFY COLUMN tracking_code VARCHAR(128) NOT NULL;
Zero-Downtime Safe Rewrite
ALTER TABLE shipments ADD INDEX idx_shipments_carrier (carrier_code, dispatched_at),
ALGORITHM=INPLACE, LOCK=NONE;
Production Rollout Notes
- Explicit LOCK=NONE makes MySQL fail fast instead of silently causing a production outage.
- For operations that require COPY (such as data type rewrites), use gh-ost or pt-online-schema-change.