Incident Library
Applied filters ComponentDatabaseSymptomWrites rejectedFactorMonitoring blind spotClear allEvery case under the filters, with no sentence; newest first.
Suggested filters Search, and the values found in your words appear here.

Graph

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

Cases5 cases

1 to 5 of 5

  1. Symptoms

    At 13:36 BST on Friday August 11th 2023, minutes after MailPace reran its data clean-up job with more memory, notifications arrived that all database transactions were failing across multiple services. The managed Postgres database had gone offline, did not come back when restarted, and reported that it was out of space.

    Trigger

    The daily retention clean-up job, which had been failing with killed, was rerun with its memory raised from 1gb to 8gb, and its large destroy_all deletions filled the database disk.

    Root cause
    Component
    Contributing factor
    Detection

    Notifications that all database transactions were failing across multiple services arrived as soon as the outage began; the provider was automatically notified at 99% storage. MailPace's two status pages did not detect the outage.

    Remediation
    • Contacted the managed database provider's support
    • Notified users on Twitter and Mastodon
    • Prepared an offsite backup from six hours earlier on a new database instance as a fallback
    • The provider migrated the database to a larger instance
    • Removed the old data in production by hand, day by day, with an updated query
    Action items
    • Delete old data in batches of 50 records with in_batches in the clean-up job
    • Run the clean-up job four times a day instead of once
    • Stay on a much larger database instance with room to grow
    • Add cron monitoring to all cron jobs
    • Point the status pages at a /health endpoint that checks database access and returns a 500 error on failure
    • Investigate a hot-replica database for automated failover
    Lessons

    Several causes came together: a clean-up job that failed silently, a naive deletion that grew huge once data had piled up, a database plan without headroom for growth, and status pages that missed the outage, presumably because https://app.mailpace.com still answered 200 while the database was down. MailPace also advises that critical services such as email sending be set up with more than one provider.

  2. Symptoms

    At 03:23 UTC on 27 March 2022, BattleMetrics' primary PostgreSQL database, which holds all account, server and player information, went into read-only mode. Users first saw the website fail to load, and soon RCON updates and queries began to fail as well.

    Trigger

    A corruption of the index on the player identifiers table, which BattleMetrics' logs place at about 26 February 2022, made every vacuum job fail, so transaction IDs kept climbing until Postgres stopped accepting writes on 27 March.

    Root cause
    Component
    Contributing factor
    Detection

    Users failed to load the website and reported it as their API keys expired, then RCON updates and queries began to fail, and the team found that the main database no longer accepted writes.

    Remediation
    • Shut the database down and dropped the corrupted player identifiers index in single-user mode
    • Ran the vacuum again, which succeeded and let the database accept writes
    • Rebuilt the player identifier index, which took about two hours
    • Shut down the query workers and gave RCON updates priority
    • Pointed services at the new Postgres primary
    • Bootstrapped new replicas one after another to take load off the primary
    • Restarted queries with throttling, prioritised by server population and rank, after RCON updates had caught up
    Action items
    • Monitor errors in the Postgres logs
    • Monitor and alert on transaction IDs
    • Set up a logical replica in addition to physical replication
    • Build a faster network to speed up recovery from failure
    Lessons

    BattleMetrics names skipping health checks on transaction ID size as its critical mistake: the index corruption silently broke vacuum for a month, and without monitoring of transaction IDs nobody saw the database approach wraparound. Because the corruption had been replicated to the replicas, failing over did not help, and the backup servers and downloadable backups carried the same corruption. The team also found that, contrary to the error message, a full vacuum on a server in wraparound protection does not need single-user mode, and chose to run a slow, delayed service over no service while replicas were rebuilt.

  3. Symptoms

    On 10 July 2019 the Stripe API failed a substantial majority of requests twice, from 16:35 to 17:02 UTC and from 21:14 to 22:47 UTC. In the first period automated monitoring detected within a minute that a database cluster had failed to elect a new primary.

    Trigger

    The primary node of a database cluster failed at 16:35 UTC while one shard had several stalled nodes. The second period was set off by rolling the election protocol back to the previous minor version at 20:42 UTC.

    Root cause
    Component
    Contributing factor
    Detection

    Automated monitoring detected the failed election within a minute, and the team was alerted at 16:36 UTC. The second period was announced at 21:14 UTC by automated alerts that some shards in the cluster were unavailable.

    Remediation
    • Restarted all nodes of the database cluster, which forced a successful primary election
    • Updated the production configuration and restarted the database cluster's nodes
    • Ramped traffic back up, putting services for user-initiated API requests first
    Action items
    • Alert when nodes stop reporting their replication lag
    • Alert when a shard enters a state that could trigger the election fault
    • Work with the database maintainers on a fix for the underlying fault
    • Add circuit breaking on failed operations to particular database clusters
    • Use fault isolation to contain the impact of a single failed shard
    • Limit the resources used by clients that keep retrying failed requests
    • Add procedures and tooling that make rapid configuration changes during incident response safer
  4. Symptoms

    From 05:35 UTC on 4 February 2019 Mandrill, Mailchimp's transactional email service, sent only 80% of queued emails, because one of its PostgreSQL shards, shard4, stopped accepting writes. When Mandrill engineers opened an investigation at 11:58 UTC, they saw a sharply elevated load on shard4.

    Trigger

    At 05:35 UTC on 4 February the transaction ID counter of shard4, the busiest Mandrill PostgreSQL shard, reached its upper limit and PostgreSQL shut the database down to protect against wraparound.

    Root cause
    Component
    Contributing factor
    Detection

    The first exception was logged overnight but was buried by unrelated exceptions in the centralized error reporting. Mandrill engineers opened an investigation at 11:58 UTC and, while looking for the source of the rising load on shard4, found the wraparound at 12:56 UTC.

    Remediation
    • Put shard4 into standalone mode and started VACUUM at 14:16 UTC on 4 February
    • Stopped and restarted the vacuum with settings that made it run faster
    • Started a dump and restore of the database without the Search and Url tables while the vacuum ran
    • Replaced storage volumes on the Mandrill app servers whose disks were filling with queued jobs and logs
    • Moved the job-queue tables from shard4 to other live shards
    • Truncated the Search and Url tables on the locked database at 19:12 UTC on 5 February, after which the vacuum finished in about an hour
    • Started sending from the backlog at 21:36 UTC
    • Added alerting for XID wraparound by 22:40 UTC
    Lessons

    Mailchimp named the factors that slowed its response: knowledge of and access to Mandrill systems and monitoring rested with a few people, Mandrill logging needed a locally writable disk, logs of malformed API requests were hard to separate from real application errors, job health was hard to see, and the disk space problem made partial deployments for triage risky. What helped was trained incident commanders with clear roles (incident commanders in 3-hour rotations, scribes, technical liaisons and points of contact between teams), periodic summaries with a list of recent and open decisions, and taking time in a video meeting to reassess, which led to the truncation. Running in the cloud let the team expand storage quickly, and the team was lucky that the largest table holding up the vacuum held data it could delete.

  5. Symptoms

    On Wednesday, February 9, 2017 at 12:30PM PT, inserts of new entries into the bookmarks table of Instapaper's MySQL database on Amazon RDS started to fail with an error. The bookmarks table, which stores the articles Instapaper users save, had grown past 2TB, and the Instapaper service was down until Thursday, February 10 at 7:30pm PT.

    Trigger

    At 12:30PM PT on February 9 the bookmarks table grew past the 2TB file size limit of the instance's filesystem.

    Root cause
    Component
    Contributing factor
    Remediation
    • Dumped the production database to a 5.5TB RAID-0 disk on an i2.8xlarge instance with Pinterest's SRE team
    • Launched a temporary production instance with limited access to archives
    • Set up an Aurora read replica of the old database as one recovery path
    • Imported the data into a new MySQL RDS instance without secondary indexes, then built the indexes
    • Had an Amazon engineer rsync the data from the ext3 filesystem to an ext4 filesystem mounted on the failed database
    • Synced the new ext4 database with the temporary production database through row-based replication
    • Promoted the new database to master and pointed the application at it
    Action items
    • Define a workflow that escalates system-wide Instapaper outages immediately to Pinterest's SRE team
    • Test MySQL backups every month instead of every three months
    • Put a process in place with Pinterest's SRE team to recover from this type of failure
    Lessons

    A filesystem limit that Instapaper did not know about and could not see made both the production database and all its backups useless, and the only way out was to restore the data onto a new filesystem. Because the hosted database could only be reached through MySQL, filesystem-level fixes such as rsync needed Amazon engineers. Even with a perfect response, rebuilding the database would have taken at least 10 hours. The lack of a disaster recovery plan for this kind of failure, and the estimate of the dump time from row counts, made the downtime and recovery longer than necessary, and the response could have drawn better on Pinterest's and AWS's people. The new escalation workflow and monthly backup tests would not have prevented this failure but would speed up the response to a future one.

Check your cluster for this

These 5 cases involve Database and PostgreSQL vacuum. 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 cause3