Skip to content

Outage explained

The GitLab database incident of January 2017, explained

A tired engineer ran a delete command on the wrong server. Then the team found that most of their backups did not work. They livestreamed the recovery.

3 min read10 sectionsUpdated

On this page

Key points

  • When: 31 January to 1 February 2017
  • Who: GitLab.com
  • Impact: GitLab.com offline for many hours; about six hours of database changes (issues, merge requests, comments) lost

What happened

GitLab.com was dealing with load from spam that was slowing database replication. While trying to restart replication late at night, an engineer meant to delete the data directory on the secondary database server so it could be re-synced, but ran the command on the primary instead. They stopped it within seconds, but most of the production data was already gone.

The team then went through their recovery options and found that several of them did not work as expected: regular database dumps had been failing silently, and other copies were incomplete. They restored from a staging snapshot taken about six hours earlier, and data created in those six hours was lost.

The root cause

A destructive command run on the wrong host during a stressful incident, and backup procedures that had not been tested and were failing without anyone being alerted.

Why it was so big

The deletion was recoverable in principle; the size of the loss came from backups that did not work. Restoring from the slow staging copy also took many hours.

Lessons for every team

Test restores, not backups

A backup is only real when you have restored from it recently. Schedule restore drills and time them.

Alert when backups fail

Silent failures are the danger. A heartbeat from every backup job, with an alert when it does not arrive, catches them.

Make the dangerous host obvious

Different prompts or colours for production, and confirmation for destructive commands, prevent wrong-host mistakes.

Be open

GitLab’s transparency during and after the incident earned a lot of goodwill.

What monitoring can and cannot do here

Monitoring could not stop the command, but heartbeat monitoring on backup jobs would have flagged the failing dumps long before they were needed. Check your job schedules with the cron expression explainer.

Source: GitLab’s postmortem of the database outage of January 31. This summary is ours; read the original for the full detail.

Frequently asked questions

What happened to GitLab in 2017?

An engineer accidentally deleted the production database directory, and several backup methods turned out not to work, so about six hours of data was lost.

Was repository code lost?

GitLab said Git repositories were not affected; database records such as issues and merge requests from that window were.

What is the main lesson?

Test your restores regularly and alert when backup jobs fail.

Check it now, free

Know about your own outages first

Uptime checks every minute, alerts with on-call escalation, incident timelines and a status page, with a free tier on every product.