
A five-minute database migration caused a 12-hour outage after a 500-million-row table rewrite locked writes and filled connection pools.
A database migration estimated at five minutes locked a core customer-order table for 47 minutes, triggering a connection cascade that took 12 hours to fully resolve, the engineering team reported in a postmortem.
The product team needed a new nullable column on a table that had grown past 500 million rows. The migration tool ran an ALTER TABLE statement. PostgreSQL initiated a full table rewrite and held a write lock during the operation. The five-minute estimate had assumed a table half that size, the team said.
Read traffic kept hitting the table during the lock. Inserts and updates were blocked. Connections queued behind the migration transaction. Application servers exhausted the database connection pool. Kubernetes recycled pods, which opened more connections and worsened the exhaustion. The monitoring system never fired a critical alert because CPU and memory remained below thresholds. The incident was connection starvation, not a resource spike. The first human signal was a customer support ticket asking if the site was down.
The team rolled back the migration at hour three. The rollback took another 32 minutes because it had to undo the same full-table rewrite. By then the application pool had been cycling long enough that cache warming took an additional 90 minutes. Full recovery, including draining stale connections and repopulating caches, took until hour twelve.
The postmortem included a single line that defined the lesson: a five-minute estimate for any operation on a table over 100 million rows is a guess. The team now uses a dedicated migration tool that runs ALTER TABLE statements with a timeout and a row-count check before acquiring a lock. The tool rejects any migration expected to take longer than the configured maximum lock duration.
That guard rail will catch the next "tiny database change" before it cascades.
Drafted by a large language model from the source reporting linked above, then screened by automated publishing checks. It is not read by a journalist before publication. Some articles cite our Alpha Score. Verify prices and figures against the original source. Educational coverage, not personalized advice.