Scenario · Storage & Backup
Base backup missing WAL
A sandboxed PostgreSQL incident — investigate with your own tools, submit a fix, and get deterministic Detect / Fix / Trap scoring.
L3 · 10–15 min · runs locally in Docker
Launch
Start this scenario
Boot it in a real PostgreSQL sandbox and investigate with psql, EXPLAIN and pg_stat_statements.
ride postgres start stage-05/05-base-backup-missing-walPart of these paths
Show the postmortem & investigation hints spoilers
Base backup missing WAL
Type: incident simulation · Topic: Storage & Backup · Level: L3 · Duration: 10–15 min
Launch: ride postgres start stage-05/05-base-backup-missing-wal
POSTMORTEM (root cause · how it was found · the fix · lesson)
Root cause: a base backup existed, but it was taken without WAL (-Xnone) and no
archive held the WAL it needed, so a restore could never reach a consistent
state. "The backup files are there" gave a false sense of safety — the backup was
not actually restorable.
How it was found: inspecting the backup showed its pg_wal empty — no WAL bundled,
nothing to replay to consistency.
The mitigation: take a new, self-contained base backup that streams WAL
(`pgpg action take-backup-with-wal`); its pg_wal is then populated and the backup
is restorable.
Lesson: a backup isn't valid because files exist — validate that it can reach
consistency (bundled WAL via -Xstream, or the required archived segments).
Don't ship/trust an incomplete backup; an index or CHECKPOINT is unrelated.
INVESTIGATION HINTS (the staged path to diagnose and fix)
1. A base backup exists on disk — but 'the files exist' is not 'the backup is restorable'. Inspect it (you're superuser): SELECT * FROM pg_ls_dir('/tmp/pgpg_backup/base/pg_wal'); it's empty, so the backup has no WAL to reach consistency.
2. The backup was taken without WAL (-Xnone) and there's no archive to fetch it from, so a restore could never finish recovery. The files being present is a false sense of safety.
3. Take a proper, self-contained backup: `pgpg action <session> take-backup-with-wal` (streams WAL into the backup). Then its pg_wal is populated and it's restorable. Don't trust the incomplete one, and an index/checkpoint is irrelevant.