Delete metadata directories a backup left without a manifest (closes #390)
check / check (push) Canceled after 0s

A backup that stopped between uploading db.zst.age and its manifest
left that directory under metadata/ on the destination for good:
prune deleted nothing there.

The blob step of prune, which snapshot create --prune also runs, now
deletes each directory under metadata/ that has no manifest.json.zst,
that no local snapshot record claims, and all of whose objects are
older than prune_grace_period; an object listed with no time keeps its
directory, and only names that are remote keys are deleted. It shares
prune's one listing of metadata/, follows the --force, prompt and
--json rules of unreferenced blobs, reports the count
(metadata_dirs_deleted, metadata_dirs_failed), and fails the run when
a delete fails.

Model: opus-5-5
This commit is contained in:
2026-10-14 21:26:39 +00:00
parent 6a57750a7b
commit ac71946170
5 changed files with 430 additions and 61 deletions
+4
View File
@@ -26,6 +26,10 @@ another sharing the destination store, that has not yet uploaded its
manifest. The grace period does not protect a blob such a backup
reuses from an earlier run that stopped before its manifest: that
blob keeps the time of its first upload, so it can be deleted.
Remote cleanup also deletes each directory under metadata/ with no
manifest, as a backup that stopped before its manifest leaves, once
all its objects are older than prune_grace_period and its snapshot is
not in the local index.
Snapshot create --prune runs the same cleanup automatically; this
command is the manual entry point for the same work (e.g. after a