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

Cases17 cases

10 to 14 of 17

  1. Symptoms

    A reader of Repro's Aurora MySQL cluster restarted for no known reason, and right after that the writer's insert latency rose to about seven times normal and writer performance stayed badly degraded for a long time. This happened more than once, twice within two weeks by 11 November 2019. While the writer was slow, the applications that process data collected by the Repro SDK fell behind, and the team could only watch until the writer recovered.

    Trigger

    Long-running queries on the reader; the author recalls that the cause was a query sent to the reader from Redash.

    Root cause
    Component
    Contributing factor
    Remediation
    • Waited for writer performance to return, since the rollback segment release could not be sped up
    Action items
    • Add a monitor on the rollback segment, mysql.innodb.history_list_length in Datadog
    • Kill queries that run long enough to make the reader restart as soon as they are found
    • Set max_execution_time so queries are stopped after a fixed time
    Lessons

    Once the rollback segment has grown large, nothing speeds up its release across the cluster, so the way to avoid the latency is to keep transactions small and stop long-running queries before the rollback segment grows.

  2. Symptoms

    At 18:40 UTC db1075, the primary database of section s3, stopped answering, and all s3 wikis went read-only because no writes could reach it. Reads kept working from the replicas. At 18:42:45 Icinga reported "PROBLEM - Host db1075 is DOWN: PING CRITICAL - Packet loss = 100%".

    Trigger

    The RAID battery backup unit (BBU) of db1075, the s3 primary database host, failed and the whole host crashed.

    Root cause
    Component
    Contributing factor
    Detection

    Icinga reported db1075 HOST DOWN on IRC at 18:42:45, but that alert does not page; replica Slave IO alerts followed, users reported problems on #wikimedia-operations, and the first SMS page went out at 18:56. Volunteers and staff noticed the failure before the alerts did.

    Remediation
    • Power-cycled db1075 from the iDRAC after finding the BBU problem
    • Let MySQL finish InnoDB recovery on db1075
    • Removed read_only=ON from db1075 by hand
    • Ran puppet by hand a second time so pt-heartbeat started
    Action items
    • Implement or refactor a script that moves replicas when the primary is unavailable
    • Fix the MediaWiki heartbeat model so pt-heartbeat does not use a super-user, avoids a single point of failure and follows the real primary without depending on puppet
    • Decide what to do with the batch of hosts that already had BBU issues
    • Buy a new BBU for db1075
    • Remove db1075 from the primary role
    • Address MediaWiki spam while the database is read-only or the primary is unavailable
    • Make primary database hosts page on HOST DOWN
    • Track hardware errors better in Netbox
    Lessons

    A BBU failure should not crash a whole host, yet it had happened before on HP hosts. HOST DOWN on a primary database should page instead of only alerting on IRC. Starting pt-heartbeat through puppet races with MySQL startup, and the unnoticed failure kept lag reported and made the outage 8 minutes longer.

  3. Symptoms

    At 22:54 UTC on 21 October 2018 GitHub's internal monitoring started alerting on many faults at once. By 23:02 UTC the first responders saw that the replication topologies of many MySQL clusters were in an unexpected state: the Orchestrator API showed topologies made only of servers in the US West Coast data center. When connectivity came back, the application tier had immediately started sending writes to the new West Coast primaries.

    Trigger

    At 22:52 UTC on 21 October, routine maintenance to replace failing 100G optical equipment cut connectivity between GitHub's US East Coast network hub and its primary US East Coast data center for 43 seconds.

    Root cause
    Component
    Contributing factor
    Detection

    GitHub's internal monitoring raised alerts on numerous faults at 22:54 UTC, two minutes after the partition. By 23:02 UTC the first responders had found, by querying the Orchestrator API, that many database clusters had a topology with only US West Coast servers.

    Remediation
    • Locked the internal deployment tooling to stop further changes
    • Paused webhook delivery and GitHub Pages builds to stop jobs writing metadata
    • Restored the affected MySQL clusters from backups into the US East Coast data center and let them replicate from the West Coast
    • Found ways to restore directly from the West Coast to get around the throughput limits of downloading from off-site storage
    • Moved all database primaries back to the US East Coast data center
    • Spread read traffic over additional MySQL read replicas in the US East Coast public cloud so replication could catch up
    • Failed over to the original topology once the replicas were in sync
    • Processed the backlog of webhook events and Pages builds, pausing to raise an internal TTL after about 200,000 webhook payloads were dropped
    Action items
    • Reconcile the writes from the captured MySQL binary logs that were not replicated, automatically where possible and with user outreach otherwise
    • Make sure status updates can be published even when GitHub Pages builds are paused
    • Give more accurate public estimates of the time to repair
    • Configure Orchestrator so it cannot promote database primaries across regional boundaries
    • Move to a status reporting mechanism that shows the status of each component of the platform
    • Serve GitHub traffic from multiple data centers in an active/active/active design with N+1 redundancy at the facility level
    • Test assumptions about the system more proactively
    • Validate failure scenarios systematically, with investment in fault injection and chaos engineering tooling
    Lessons

    Orchestrator did what it was configured to do, but the application tier could not work with primaries on the other side of the country: leader election within one region is generally safe, while the sudden cross-country latency was a major contributing factor. The behaviour emerged from a partition larger than any GitHub had seen. Replication caught up along a power decay curve, not a straight line, so the linear estimates of recovery time were wrong. GitHub concluded that tighter operational controls and faster response are not enough on their own and that failure scenarios have to be validated before they happen.

  4. Symptoms

    On 7 August 2017, while checking the application after the maintenance that moved Mackerel from an on-premises data center to AWS, the team found that data updated during a specific time window was missing. Everything written to the PostgreSQL database between 14:30 and 15:30 JST was gone.

    Trigger

    One hour after the application was switched to the newly promoted primary db001, db001 lost network connectivity and the database failed over to the standby db002.

    Root cause
    Component
    Contributing factor
    Detection

    The team found the missing data while checking how the application behaved after the migration work.

    Remediation
    • Tried to restore the lost updates by hand from the table data left on db001 and gave up
    • Tried point-in-time recovery from the base backup and WAL and gave up
    • Built a new replica db003 with db002 as primary to restore redundancy
    • Kept db001 in maintenance state for investigation
    • Watched db002 for some time to confirm the problem did not recur, then completed the migration
    Action items
    • Change the PostgreSQL replica creation script to set recovery_target_timeline = 'latest' in recovery.conf by default
    • Add a check to a server configuration test tool such as Serverspec that recovery.conf contains recovery_target_timeline = 'latest'
    Lessons

    A setting needed only for a rare layout, such as a grandchild replica during a migration, was applied by hand through a script option and was forgotten. Because recovery_target_timeline = 'latest' is harmless on ordinary standbys too, Hatena now sets it by default whenever a replica is created. The staging rehearsal used the same layout and steps but had the setting right, so it could not catch the mistake. Hatena notes that a similar layout may be used again for a future PostgreSQL upgrade or a move to another region.

  5. Symptoms

    From around 19:00 UTC on 31 January 2017, load on GitLab.com's PostgreSQL database rose, which GitLab suspected was spam, and many users could not post comments on issues and merge requests. Around 23:00 UTC the replication of the PostgreSQL secondary fell behind and then failed, because WAL segments it still needed had already been removed from the primary.

    Trigger

    While trying to restore replication to the secondary, an engineer ran the removal of the PostgreSQL data directory on the primary, db1.cluster.gitlab.com, believing it was the secondary.

    Root cause
    Component
    Contributing factor
    Detection

    The engineer who ran the deletion on the primary noticed the mistake and stopped it a second or two later.

    Remediation
    • Raised max_wal_senders from 3 to 32 and lowered max_connections from 8000 to 2000 so PostgreSQL would restart
    • Stopped the deletion on the primary a second or two after noticing it
    • Restored the database from the LVM snapshot taken about 6 hours before the outage by copying the PostgreSQL data directory from staging
    • Restored the webhooks from a separate database built from the snapshot and imported them as a SQL dump
    • Incremented all database sequences by 100,000 so IDs used before the outage could not be reused
    • Re-enabled GitLab.com gradually
    • Rebuilt projects created after 17:20 UTC in basic form from their Git repositories on the NFS cluster
    Action items
    • Change the shell prompt (PS1) on all hosts to show more clearly which host and environment is in use
    • Monitor backups with Prometheus
    • Set PostgreSQL's max_connections to a sane value
    • Investigate point-in-time recovery and continuous archiving for PostgreSQL
    • Take LVM snapshots of the production databases every hour
    • Take Azure disk snapshots of the production databases
    • Move staging to the ARM environment
    • Recover the production replicas
    • Test recovery of PostgreSQL database backups automatically
    • Improve the PostgreSQL replication documentation and runbooks
    • Investigate pgbarman for PostgreSQL backups
    • Investigate WAL-E for database backup and realtime replication
    • Build a streaming database restore
    • Assign an owner for data durability
    • Set up multiple secondaries and balance load among them with pgpool-II
    • Provide a tool for developers to run and revert Rails migrations on staging
    • Build owned recovery procedures for the rest of the GitLab.com infrastructure, not only the database
    • Publish a backup monitoring dashboard and add more backup data to it
    • Improve the abuse reporting and response system so removal for spam does not hard delete
    • Redact engineers' names in future public incident documents
    Lessons

    GitLab split the incident into two problems: GitLab.com went down because the primary's data directory was removed by mistake during a manual, undocumented replication rebuild, and recovery took over 18 hours because the backups had failed silently, disk snapshots were not enabled and the only copy sat on slow staging disks. The backup procedure was never tested because no one owned it. GitLab chose to focus on fast, regularly practised recovery and on making it obvious which host an engineer is on, rather than on blocking commands, since a safer rm only protects against one of many ways to lose data.

Check your cluster for this

These 17 cases involve Database and Database replication. 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 cause8

Capacity exhaustion4 cases

  1. IL-0379 InfluxDB Cloud queries in Azure West Europe slowed and timed out as storage pods fell behind and kept restarting
  2. IL-0288 ZooKeeperWait rose to thousands of seconds on three redundant ClickHouse instances, degrading a CDN77 data pipeline
    CDN772026
  3. IL-0305 Replicas of one Intercom Vitess shard hit 100% CPU and fell up to 2.2 hours behind, serving stale inbox data
  4. IL-0443 A Repro Aurora MySQL reader restarted unexpectedly and writer insert latency rose about sevenfold for a day or more
    Repro2019

Cloud provider outage2 cases

  1. IL-0322 A GCP storage incident degraded the disk under GitLab.com's primary PostgreSQL and caused two bursts of site-wide 503s
    GitLab2026
  2. IL-0368 PlanetScale's control plane went down and some database branches failed queries during the AWS us-east-1 outage

Breaking change in an upgrade1 case

Contributing factor
Organisation
  1. IL-0569 After an MHA master failover, one of three MySQL replicas failed with a malformed binlog error and could not catch up
    DeNA2026

Software defect3 cases

  1. IL-0527 OpenStreetMap.org made no replication diffs for 16 hours as PostgreSQL logical decoding failed on a memory alloc error
  2. IL-0589 Every Kickstarter MySQL replica on Amazon RDS stopped replicating on a duplicate-key error in the backings table
  3. IL-0303 GitHub's MySQL master failed over to a node with a cold buffer pool during a schema migration and GitHub.com went down
    GitHub2012

Configuration change2 cases

  1. IL-0392 MariaDB replication of section x1 between eqiad and codfw broke on a missing heartbeat row during a cookbook run
  2. IL-0331 An RDS MySQL Multi-AZ failover lost 5 seconds of committed data and broke replication on all five read replicas

Hardware failure1 case

  1. IL-0323 A RAID battery backup unit failure crashed db1075, the MariaDB primary of section s3, and every s3 wiki went read-only

DNS or network fault1 case

Organisation
  1. IL-0210 GitHub's MySQL clusters failed over to the US West Coast and the site served slow, stale, inconsistent data for 24 hours
    GitHub2018

Operator error3 cases

  1. IL-0431 During Mackerel's move to AWS, PostgreSQL failed over to a replica that had stopped replicating, losing an hour of data
    Hatena2017
  2. IL-0218 GitLab.com's primary PostgreSQL data was wiped by mistake and, with no working backup, the site was down about 18 hours
    GitLab2017
  3. IL-0319 Dropping databases on the MySQL replica mysql2 also dropped them on mysql1, as the pair actually ran master-master