Lesson 11 of 13 · 15m
The Restore Test Nobody Runs
GitLab's five backup mechanisms all failed at once because none had ever been restored; drills turn hypotheses into facts.
The most reliable sentence in disaster recovery is that the first restore attempt happens during the outage. Backup monitoring watches the writer; restore testing exercises the reader — and the reader is the product. The verification ladder has four rungs, and most setups stop at the first.
The ladder
- Artifact existence. The snapshot is listed (
restic snapshots), the dump file is non-zero, the WAL archive is filling. Minimum viable check — catches the empty-dump class — and not sufficient alone. - Integrity.
restic checkverifies the repository structure;restic check --read-data-subset=10%samples actual pack contents against their hashes.pg_restore --list dump.pgcparses the archive header and table of contents — this single command would have caught GitLab's silently-emptypg_dumpartifacts, months before they were needed.sha256sumcomparisons,gzip -ton compressed dumps,borg check. Cheap, schedulable, catches corruption near write time. - Functional restore. Restore to a scratch VM or container, boot the service, run the app's own smoke checks. This is the only rung that tests the full chain — dump format, WAL replay, schema load, app compatibility — and the only one that answers "does the service actually come back." One hazard nobody prices in: a functional restore boots a clone of production, and a cloned cron job will happily send real email and hit real third-party APIs. Drills belong on a no-egress namespace or against stubbed integrations — otherwise your restore test pages your customers.
- Timed. Record the wall clock. Restore duration is the empirical RTO input; a drill that takes 9 hours against a 4-hour RTO is a failed test with green artifacts.
The evidence: GitLab, again
The January 2017 incident earns a second citation because it is the canonical restore-testing failure. Five mechanisms existed on paper. The pg_dump backups in S3 were empty — generated by 9.2 binaries against a 9.6 database — and the failure was invisible because nobody ran pg_restore --list on what they were shipping. Azure snapshots covered the wrong servers. LVM snapshots were stale. Replication was already broken. Each layer was a plausible checkmark in a review; none had ever produced a running system. The team discovered all of it live, on a livestream, while restoring the site.
There is a quieter version of this in every shop: the backup that stopped covering a new table, a new volume, a new service — because the job was configured in 2022 and the system grew around it. Restore testing catches coverage drift too, because a restore of an incomplete artifact boots a broken service, which is a loud signal.
The pattern to internalize: the failure modes were all at restore time. The writers all ran fine. Backup systems are green by construction and broken by default; only restores reveal which.
Wrong model: monitoring the exit code
"Cron mailed success" and "the monitoring shows the job ran" describe process completion, not artifact viability. Exit 0 with a zero-byte artifact is the exact failure shape of the most common backup disaster. Monitoring must assert on the artifact: size sanity (dump today ≈ dump yesterday ± growth), repo check output, and drill results.
The practice
Automate it. A scheduled pipeline — CI job or a cron on the backup host — that picks the latest snapshot, restores to an ephemeral target, boots, checks, logs duration, and pages on failure. Two details that make drills honest: restore a random snapshot sometimes, not always latest — an incremental chain or a retention-pruned gap only shows up when you pick an older point — and keep a drill log with duration, artifact id, and result, because "we test restores" without records is another rumor. Monthly minimum for functional restores; integrity sampling weekly is cheap enough to be automatic. Once a quarter, the full dress: whole stack restored to clean VMs, timed end to end, results written next to the RTO you promised. A backup unverified this quarter is a hypothesis; a backup verified is still just one data point — but at least it's an honest one.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Self-Hosting Prometheus and Grafana: Infrastructure Monitoring That Actually Works
Build a production-grade monitoring stack with Prometheus and Grafana from scratch. Covers architecture, Docker Compose deployment, Node Exporter, alerting with Alertmanager, PromQL from basics to advanced, pre-built dashboards, and everything SudoSecurity uses to monitor its own infrastructure.
Zero Trust Everything: The Complete Guide to Self-Hosting Teleport for Secure Infrastructure Access
SudoSecurity runs Teleport internally for everything — admin panel access, secure database connections, Kubernetes, and zero-trust philosophy across our entire team. This is the complete technical guide to installing, configuring, and running your own self-hosted Teleport cluster from scratch.
Running a Minecraft Network: Four JVMs, One Box, and the Settings That Lie to You
Four servers on one host means four JVMs each sizing its thread pools for a machine it does not own. The measured cost of that, the systemd ordering that guarantees nothing, and the throttle that switches itself back on when your forwarding breaks.
Building a Minecraft Network: Four Servers Pretending to Be One Place
A proxy, a lobby, an SMP and a PvP arena is four JVMs that know nothing about each other. What actually has to be shared, why your permissions don't follow players, and the two LuckPerms defaults that silently share nothing at all.