Software DisastersEpisode 01 · GitLab.com database outage · 31 January 2017

GitLab Had Five Backups. None of Them Worked

A delete command meant for a replica ran on the primary. Then GitLab found that none of its five backup and replication mechanisms could bring the data back.

Get the Claude skill

· Watch on YouTube

Free Claude skill · read-only

Backup reality check

Claude reads your repository and infrastructure files and tells you where a GitLab-style night could lose data, with file and line evidence and the first fix to make.

  • Restores are tested A scheduled job restores the newest backup and queries it.
  • Silence pages someone A missing success heartbeat alerts, not just a failure email.
  • Tools match the server The dump client isn’t older than the database it dumps.
  • Replicas aren’t backups A bad delete reaches a replica in milliseconds.
  • Point-in-time recovery How many hours of writes you’d really lose.
  • Destructive steps are guarded Scripts check the host’s role before wiping data.
  • Recovery is fast and written down A restore runbook exists and has been timed.
  • Someone owns it Backups are a system, and systems need an owner.

You’ll get a download link by email. Using it confirms your address and subscribes you to new Software Disasters episodes. Unsubscribe anytime. About your email

Install: unzip into ~/.claude/skills/ for Claude Code, or upload the zip under Skills in Claude’s settings. Then ask: “Run the backup reality check on this repo.”

What happened

Two seconds on the wrong server.

Late on 31 January 2017, GitLab.com’s database standby fell behind under heavy load. The write-ahead log it needed had already been removed from the primary, and WAL archiving wasn’t set up, so the standby had to be wiped and rebuilt by hand.

The rebuild tool sat silent, which turned out to be normal but undocumented. An engineer wiped the standby’s data directory again to clear what looked like leftover files. That command ran on db1, the primary, instead of db2. They stopped it within a second or two. Of about 300 GB, roughly 4.5 GB was left.

GitLab.com was down for about 18 hours. Database changes made after 17:20 UTC that day were lost; GitLab estimated about 5,000 projects, 5,000 comments and 700 new accounts. Recovery came from a copy an engineer had made six hours earlier for unrelated testing.

The safety net

Five mechanisms. None saved the data.

  1. ReplicationBuilt for failover, not disaster recovery. It had just been wiped for resync.
  2. WAL archiveNot configured, so there was no point-in-time recovery.
  3. Azure disk snapshotsEnabled for file servers, not for database servers.
  4. LVM snapshotsMade daily to refresh staging, not meant for recovery.
  5. pg_dump to S3Ran the wrong pg_dump version every night. The failure emails were rejected. The bucket was empty.

What to take away

You don’t have a backup until you’ve restored it.

  • A backup you haven’t restored is a hope, not a backup.
  • Alert on silence, not only on errors.
  • Know which recovery tool protects against which failure.
  • Make recovery fast, not just possible.
  • Make the dangerous context obvious.
  • Give data durability an owner.

When did someone last restore your backup, and how long did it take?

Check your own repository with the skill