Skip to content
All outages

Incident · Medium · Databases

The empty table that blocked everything

  • SEV2
  • ~1 MINUTE
  • DURING A MIGRATION
90s

The situation

You run a migration that adds a foreign key from a brand-new, empty table to your busy users table. It should be instant. Instead the whole site hangs for about a minute. Every query that touches users is stuck, including simple reads.

The evidence

Logs and signalsReconstructed
14:00:00pid 811: long analytics SELECT on users (running 4 min)
14:00:05pid 902: ALTER TABLE … ADD FOREIGN KEY → waiting for lock
14:00:06pid 903: SELECT … FROM users → waiting
14:00:06pid 904–1260: SELECT … FROM users → waiting
14:01:02pid 811 finished → everything drains

Your call

Why did reads block?

Charts and logs are reconstructions. Aim for 90 seconds; going over costs nothing.

Last updated: Engineering write-up