Incident Library
  • Root cause
  • Component
  • Symptom
  • Contributing factor
  • Case

Cases8 cases

7 to 8 of 8

  1. Symptoms

    On 27 November 2021 at 20:40 UTC, a significant part of GitHub's MySQL read replicas entered a semaphore deadlock while a schema migration on a large MySQL table ran its final step, the rename that moves the updated table into place. Core GitHub services, including GitHub Actions, API Requests, Codespaces, Git Operations, Issues, GitHub Packages, GitHub Pages, Pull Requests and Webhooks, became degraded.

    Trigger

    The final rename step of a schema migration on a large MySQL table. Schema migrations are a common task at GitHub and often take weeks to complete.

    Root cause
    Component
    Contributing factor
    Remediation
    • Promoted every healthy internal replica into the production path to add read capacity
    • Removed production traffic from the broken replicas until each had processed the table rename
    • Moved the recovered replicas back into production to restore capacity
    Action items
    • Continue functional partitioning so migrations can run in canary mode on a single shard
    • Update internal procedures to increase how much each cluster is over-provisioned
    • Pause schema migrations until it is known how to safeguard against this failure
    • Keep investigating the specific failure scenario
    • Test the migration tooling and classify ways to improve it for this kind of scenario
  2. Symptoms

    Just after a planned Postgres schema migration started, GoCardless received alerts that API requests were timing out. The API was down for about 15 seconds, until the migration went through and the API came back.

    Trigger

    A deploy with a schema migration that renamed the empty invoicing tables and dropped and recreated their foreign key constraints, which referenced some of the most heavily used tables.

    Root cause
    Component
    Contributing factor
    Detection

    Alerts about API requests timing out began just after the schema migration started.

    Lessons

    Avoiding renames of tables in use, table rewrites under an exclusive lock and expensive work while holding one was not enough for GoCardless: a short DDL statement can still cause downtime by waiting in the lock queue behind a long-running query. GoCardless recommends removing long-running queries and transactions from the application and running analytics on an asynchronously updated replica, setting log_min_duration_statement and log_lock_waits to find such queries, setting lock_timeout in migration scripts so a deploy aborts rather than taking the application down, splitting schema changes so locks are held for shorter times, and keeping Postgres up to date. Developers with a console on the production database can cause the same downtime by leaving a transaction open.

Check your cluster for this

These 8 cases involve Database and Schema migration. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.

By root cause2

Software defect2 cases

Organisation
  1. IL-0451 Setting indexes INVISIBLE on Aurora MySQL 3.10 spiked CPU and ReadIOPS on all three readers but not on the writer
    Daangn2026
  2. IL-0385 GitHub MySQL read replicas hit a semaphore deadlock during a schema migration's table rename and kept crash-recovering
    GitHub2021

Faulty deployment6 cases

  1. IL-0570 Dropping an unused MySQL table stalled queries on its busy parent table and crowdworks.jp was hard to reach for a minute
  2. IL-0369 Railway's backend API went down when a column migration waited on locks and replicas could not get database connections
  3. IL-0554 A database migration used up Sentry US's Postgres connections, and the site and event ingestion were down for 22 minutes
    Sentry2024
  4. IL-0523 TANF-app production deployments were blocked for two months when a search-index migration ran out of database disk space
  5. IL-0524 An index migration locked Open Collective's whole Transactions table and degraded the service for nearly an hour
  6. IL-0391 GoCardless API requests timed out for about 15 seconds while a Postgres migration waited for an AccessExclusive lock