Graph
Cases4 cases
1 to 4 of 4
- Symptoms
On 2 September 2025 the matrix.org homeserver went down at 17:45 UTC and stayed down until 18:00 UTC the next day. Both machines of its PostgreSQL cluster were out of action: the original primary had lost its RAID array during a disk expansion, and the data directory of the new primary had been deleted by mistake.
- Trigger
During maintenance to add drives, an existing drive disappeared from the primary database server's RAID 10 array at 11:17 UTC, which led to a failover and a rebuild of that server. The outage itself began when the data directory of the new primary on db-01 was deleted while clearing a failed restore on db-02.
- Root cause
- Component
- Contributing factor
- Detection
Monitoring fired when the drive disappeared from db-02's RAID array at 11:17 UTC, and Mythic Beasts confirmed the issue. The team realised it had deleted db-01's data directory, and the backend team was then paged, an incident was opened and an emergency was declared.
- Remediation
- Created a fresh RAID 10 array on db-02
- Unblocked WAL archiving from the new primary on db-01 to S3
- Started restoring db-02 from the S3 backups with wal-g
- Shut down Synapse and the damaged primary database
- Remounted the data partition of db-01 read-only
- Copied the WALs missing from S3 from db-01 to db-02
- Updated wal-g and patched it to continue from the partial restore
- Configured a restore_command wrapper that fetched WALs from S3 and the local files, and replayed them in standby mode
- Promoted db-02 to primary and restarted Synapse
- Ran backups against the primary while no replica existed
- Rebuilt db-01 as a replica from a base backup of db-02
- Action items
- Run pg_repack to reclaim free space
- Take incremental backups more often, since they restore faster than WAL replay
- Reduce Synapse's storage requirements
- Consider changing the terminal background colour by the database's role, for example by watching for the standby.signal file
- Consider wrapper scripts around sensitive commands, such as an alias for rm, and automating operations such as starting a base backup from primary to secondary
- Shorten the recovery time, with infrastructure from service providers
- Upgrade wal-g on all servers and repeat disaster recovery testing with it
- Explore ZFS local snapshots at the next hardware refresh
- Make status.matrix.org the source of truth during incidents and keep social media updated
- Lessons
Most of the difficulty came from the size of the database: restoring 51TB and replaying WALs took far longer than hoped, and incremental backups restore much faster than WAL replay. Running a destructive command on the wrong server was the turning point, and Matrix.org looks for better tooling and processes rather than blaming the individual; working as a trio did not catch the mistake, and server names that suggest a role caused confusion because a primary and a secondary swap roles. The recovery lost no data, but the recovery time needs to be shorter, and the wal-g versions on the disaster recovery server and the production servers had drifted apart.
IL-0565Cookie Run: Kingdom's CockroachDB cluster failed when 16 of 24 nodes lost their filesystems, causing a 36-hour outageDevsisters2022- Symptoms
Right after a script ran on the CockroachDB nodes behind Cookie Run: Kingdom, hundreds of alerts fired at once for error rate, database connections and health checks, and the game could no longer be played normally. Emergency maintenance started at 16:52.
- Trigger
On the Monday after the launch weekend, storage use was growing with the number of users and the cluster had about 36 hours left before its disks would fill. The team ran a prepared script to create ballast files on every node, as the official guide for CockroachDB 19.1.11 recommends. The ballast file path in the script was set wrong and pointed at a block device, and the command had no check for an existing file at the target path, so it overwrote the partition.
- Root cause
- Component
- Contributing factor
- Detection
Metrics and alerts set up in advance fired hundreds of alerts on error rate, database connections and health checks right after the script ran.
- Remediation
- Started emergency maintenance of the game at 16:52
- Wrote Spark code that extracts the contents of CockroachDB SST files to CSV, and modified the CockroachDB CLI to make it more than 10 times faster
- Converted about 7.5TB of SST files from the 7 surviving nodes to CSV
- Deduplicated the extracted rows and merged them into one large CSV file that could be imported
- Imported the latest snapshot and the latest 300 journal entries per user into a new cluster with more storage
- Restored the other tables from the latest backup and rebuilt the user table from snapshots and journals with server logic
- Checked the restored data against a database restored from backup, against analytics logs for sampled users, and with snapshot replay for every user
- Reopened the game at 23:37 on the second day, after 30 hours 50 minutes
- Failed over the AWS RDS database of the DevPlay platform after the reopening traffic overloaded it
- Built a third database cluster on more m5d instances and moved the data with the official backup and restore
- Ended the maintenance at 8:30, after 36 hours 29 minutes
- Action items
- Require at least two engineers for any work on production infrastructure, however small
- Write the scripts and the scenario for each infrastructure task in advance and have the team review them
- Lessons
Because a person's mistake caused the failure, Devsisters changed its process for infrastructure work rather than relying on individual care: even experienced engineers make mistakes, so the prevention has to be built into the system. The author credits the recovery to an incident policy that does not blame the individual and asks for detailed records, to past incidents that were written down so people without the experience knew what to do, and to having infrastructure operations and data analysis teams with the needed infrastructure and skills in one organisation.
IL-0591Gitpod workspaces in all regions became IO bound and unresponsive for days after the ws39 workspace cluster releaseGitpod2022- Symptoms
From April 11, 2022 at 13:17 UTC customers and Gitpod staff reported that Gitpod workspaces were intermittently becoming unresponsive. CPU usage of nodes and pods looked normal, with nothing maxed out, and at 13:58 UTC the team found that the workspaces were IO bound rather than CPU bound.
- Trigger
The ws39 generation of workspace clusters, released to all regional clusters on April 8th at 20:08 UTC and to the XL clusters on April 9th at 17:45 UTC, split the 1TB disk into smaller RAID0 disks, changed CPU limiting and workspace networking, and moved to faster machine types.
- Root cause
- Component
- Contributing factor
- Detection
Customers and Gitpod staff reported on April 11th at 13:17 UTC that workspaces were intermittently unresponsive, and the team opened an incident in Slack through its incident.io integration. On April 17th the team noticed increased CPU load on the workspace nodes and opened an internal incident.
- Remediation
- Shifted workspace starts back to the ws38 clusters on April 11th
- Built ws39a clusters with c2d machines and local SSDs and moved traffic to them
- Requested a limit increase from Let's Encrypt
- Routed EU XL traffic to the regional EU cluster and built ws-eu39bxl to replace the crashed ws-eu39xl
- Cleaned up workspaces stuck in a stopping state so users could start them again
- Released ws40 with 1TB boot disks to get more IO bandwidth
- Removed the workspaces that consumed excessive CPU time for crypto-mining
- Blocked the fraudulent users behind the crypto-mining from using Gitpod
- Rolled back the ws-daemon change that broke CPU limiting and shipped the fix in the ws34 clusters
- Blocked ACME HTTP requests to workspace ports so Let's Encrypt rate limits would not be hit again
- Rolled out IO limiting with the ws41xl and ws41 clusters and moved traffic to them step by step
- Action items
- Invest in test automation so that test results stop releases like this one
- Vary the interval between traffic shifts to new clusters, with more time for larger releases
- Add a risk assessment stage, to be automated, that governs changeset size and rollout speed of workspace cluster rollouts
- Reduce the impact teams have on each other
- Add review criteria that find backwards incompatible changes before pull requests are merged, and split such pull requests
- Recommend rollback as the primary means of mitigation in the incident procedures, and look at automating it
- Make the status page show the workspace service as down when it is, and update the playbooks
- Keep incident communication in a single Slack channel and Google Meet
- Put 10% of the engineering staff on the on-call rotation from May 9th and use that time on observability, alerting and stability
- Lessons
Gitpod concluded that it should have committed to rolling back on April 11th instead of building and shipping fixes, which kept customers on degraded workspaces longer than necessary. A large release so soon after the previous one needed a risk assessment and slower traffic shifts, and backwards incompatible changes that block a rollback need to be found before pull requests are merged. Failure-free operations require experience with failure.
IL-0431During Mackerel's move to AWS, PostgreSQL failed over to a replica that had stopped replicating, losing an hour of dataHatena2017- 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.
These 4 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 cause2
Operator error3 cases
- Contributing factor
- Organisation
IL-0242Both PostgreSQL servers behind matrix.org were lost during a disk expansion, and the homeserver was down for 24 hoursIL-0565Cookie Run: Kingdom's CockroachDB cluster failed when 16 of 24 nodes lost their filesystems, causing a 36-hour outageDevsisters2022IL-0431During Mackerel's move to AWS, PostgreSQL failed over to a replica that had stopped replicating, losing an hour of dataHatena2017
Faulty deployment1 case
- Component
- Contributing factor
- Organisation