Code RoomSchema migration half-applied across shards
HardPrep Room Coding #2687

Schema migration half-applied across shards

On-callDistributed systemsSenior–Staff~40 min

A schema migration adds a `currency` column (defaulting writes to a per-row value) across a 16-shard MySQL fleet for an `orders` table. The migration runner applies DDL shard-by-shard. At 03:20 it failed partway: shards 0–9 have the new column, shards 10–15 don't. The runner reported failure and paged, but the API kept serving. Now reads are inconsistent: orders on migrated shards return a currency, orders on un-migrated shards 500 on the new code path that expects the column, and a reporting job is summing amounts across currencies as if they were all USD. How do you triage, stabilize, and safely complete the migration?

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

0:00 of about 40 min
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.