Cases3 cases
1 to 3 of 3
IL-0321GCP snapshots on all Patroni nodes stalled GitLab.com's primary PostgreSQL disk, Patroni failed over and 5xx spikedGitLab2021- Symptoms
At 23:38 UTC on 2021-01-16 GitLab.com error rates spiked, and a minute later multiple alerts for service disruption arrived, two minutes after GCP disk snapshots had been started on all Patroni database nodes. Some requests that needed database writes returned 5xx errors for about four to five minutes, while page refreshes checked during the incident responded normally.
- Trigger
During the change production#2648, at 23:36 UTC an engineer started GCP disk snapshots on all Patroni nodes at the same time, as a safety step before a change to the filesystem, believing the snapshot was a transparent background operation through the GCP API.
- Root cause
- Component
- Contributing factor
- Detection
A flood of alerts about downstream impact; multiple service disruption alerts arrived at 23:39 UTC, a minute after the error spikes began. The incident was declared in Slack at 23:56.
- Remediation
- Patroni invalidated patroni-06's lock and promoted patroni-03 as the new primary
- Cancelled the snapshot requests in two of the three zones
- Action items
- Update the Patroni and PostgreSQL runbooks to clarify GCP snapshot best practices
- Add a checklist for change management reviewers and approvers to the runbooks, referenced in the handbook
- Schedule a call with Google about IO sensitivities
- Lessons
Do not take a GCP snapshot of a running PostgreSQL leader. Technical reviewers have to review every change or addition to a change request's description before a manager or director approves it. The Datastores team should explain in detail how backups and snapshots work on the production database. No action belonging to a change should start before the change's scheduled start.
IL-0518gitlab.freedesktop.org on GKE ran short of volume space and a planned 30-minute storage upgrade became a 4-hour outagefreedesktop.org2018- Symptoms
Shortly after 9am UTC on 17 July 2018, the disk space of the GitLab cluster behind gitlab.freedesktop.org was critical, and some API requests were failing because of the shortage. The administrator first learned of the failure when people mentioned it on IRC.
- Trigger
Many recently created forks of Mesa, each about 2.1GB, filled the disk space of the GitLab cluster.
- Root cause
- Component
- Contributing factor
- Detection
People mentioned the failure on IRC. Monitoring and alerting on disk usage and API error rate had not been set up yet.
- Remediation
- Dropped all inbound traffic to GitLab at the firewall except from the administrator's IP
- Took a manual backup by streaming tar over SSH to an encrypted partition on a local machine
- Snapshotted all GCE disks behind the PersistentVolumes
- Copied the data from the old disk snapshots to new enlarged volumes through a temporary GCE VM
- Re-did the copy into new empty volumes with the correct directory structure and checked repositories, users and workflows
- Restored public access to GitLab
- Action items
- Set up monitoring, logging and alerts
- Find ways to communicate outages much better; this one was announced only on IRC, and the lists were not told when it dragged on
- Use the Cloud console clients instead of the slow Cloud Console web UI
- Add more GitLab administrators, ideally someone familiar with Kubernetes deployments
- Move from the single Omnibus container to GitLab's cloud native deployment with one container per service
- Move storage to resizeable volumes or to Google Cloud Storage
- Lessons
The backup step alone used up the outage window; backups had grown along with the disk problem, and a test run before announcing the window could have measured it. The changes had been tested on a scratch cluster, but not exactly as run, and tests of steps such as disk snapshots could have been more realistic. A single GitLab administrator who was new to Kubernetes was a single point of failure. Keeping at least three copies of the data from the first destructive step meant no data was lost.
IL-0218GitLab.com's primary PostgreSQL data was wiped by mistake and, with no working backup, the site was down about 18 hoursGitLab2017- 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.
These 3 cases involve Cloud block storage and Database. 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
Capacity exhaustion2 cases
- Component
- Contributing factor
- Organisation
Operator error1 case
- Contributing factor
- Organisation