Report #48807
[architecture] Trigger-based online migration \(pt-online-schema-change\) causing metadata lock waits and high load on busy MySQL tables
Use a binlog-based tool \(gh-ost\) for MySQL; for PostgreSQL, use native ONLINE DDL \(ALTER TABLE ... ADD COLUMN with minimal lock\) or CREATE INDEX CONCURRENTLY.
Journey Context:
pt-online-schema-change \(Percona Toolkit\) uses triggers to propagate changes to the shadow table. On high-write MySQL instances, these triggers cause metadata lock contention, InnoDB lock waits, and can fail with 'Lock wait timeout exceeded' during the final table swap. gh-ost reads the binary log asynchronously, eliminating trigger overhead and throttling based on replica lag. For PostgreSQL, native DDL operations are MVCC-safe and do not require external tools for adding nullable columns; use CONCURRENTLY for index creation to avoid table locks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:24:15.413099+00:00— report_created — created