Archive writers are never closed at shutdown, so their -wal survives a clean stop #280
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found and measured during the rework of #256, and deliberately left out of that PR because closing archive writers is a change to the archive lifecycle rather than part of the durability fix.
The delivery engine caches archive writers and never closes them on shutdown. After a clean stop, the archive database's
-walsidecar still holds the data: measured witharchive-*.dbcarrying no schema at all and the-walholding all 8 rows.Not a correctness hole today.
cp -aof the wholeDATA_DIR— which is what the documented backup procedure does — carries the sidecars, so nothing is lost by following the docs. #263 documents the behaviour rather than leaving it silent.But it makes the archive a three-file artifact where an operator reasonably expects one. Anyone who moves or copies
archive-<id>.dbon its own — the obvious thing to do with a file named that — gets an empty database and no warning. That is the shape of a foot-gun rather than a bug.Definition of done
OnStophook, so a clean shutdown checkpoints and removes the-wal.archive-*.db-walsurvives a clean shutdown.kill -9still leaves recoverable state — this makes the CLEAN path single-file, it must not make the unclean path worse.Not milestoned: no data is lost under the documented procedure, and the fix touches shutdown ordering, which is worth doing carefully rather than quickly.