Keep the local index when remote nuke cannot list or find the destination #384

Merged
clawbot merged 1 commits from issue-292-nuke-keeps-local-index into next 2026-10-14 06:47:40 +02:00
Collaborator

Fixes #292.

remote nuke runs the bulk snapshot remove, which turned a failed listing of the destination store into a warning so that a local-only remove would not be blocked. Nuke then cleared the local snapshot records. Against a destination it could not list, every remote delete then failed, and the snapshots were left on the store without their names. Against an unplugged volume's empty mount point (snapshots in the local index, no vaultik-destination.txt), it deleted nothing, printed "Backup destination store is now empty." and exited zero.

  • Nuke now fails on either before it removes anything, and without its advice to run it again: that run would fail the same way, and for the missing marker the error says to mount the volume.
  • The bulk remove fails on either too; only a local-only remove still goes on with a warning. snapshot remove --local-only does not use it and is unchanged.
  • Each snapshot's remote metadata is deleted before its local record, and the local record is dropped only once that delete succeeded. A local delete that fails after it leaves a local snapshot without remote metadata, which prune reconciles.
  • README (remote nuke, remote storage layout), ARCHITECTURE.md and docs/REPOSTRUCTURE.md now name remote nuke among the commands that fail without the marker.
  • No TODO.md entry: see #334.

Judgement call: to leave the advice off these two refusals, nuke lists the destination's snapshot metadata next to its binding check, before deleting; the bulk remove then lists it again.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/292. `remote nuke` runs the bulk snapshot remove, which turned a failed listing of the destination store into a warning so that a local-only remove would not be blocked. Nuke then cleared the local snapshot records. Against a destination it could not list, every remote delete then failed, and the snapshots were left on the store without their names. Against an unplugged volume's empty mount point (snapshots in the local index, no `vaultik-destination.txt`), it deleted nothing, printed "Backup destination store is now empty." and exited zero. - Nuke now fails on either before it removes anything, and without its advice to run it again: that run would fail the same way, and for the missing marker the error says to mount the volume. - The bulk remove fails on either too; only a local-only remove still goes on with a warning. `snapshot remove --local-only` does not use it and is unchanged. - Each snapshot's remote metadata is deleted before its local record, and the local record is dropped only once that delete succeeded. A local delete that fails after it leaves a local snapshot without remote metadata, which `prune` reconciles. - README (`remote nuke`, remote storage layout), `ARCHITECTURE.md` and `docs/REPOSTRUCTURE.md` now name `remote nuke` among the commands that fail without the marker. - No `TODO.md` entry: see https://git.eeqj.de/sneak/vaultik/issues/334. Judgement call: to leave the advice off these two refusals, nuke lists the destination's snapshot metadata next to its binding check, before deleting; the bulk remove then lists it again. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 06:10:49 +02:00
clawbot self-assigned this 2026-10-14 06:10:49 +02:00
Author
Collaborator
  • NukeRemote in internal/vaultik/prune.go: on the two new refusals (a destination store that cannot be listed, and one without vaultik-destination.txt while the local index holds snapshots), nuke still warns "Run 'vaultik remote nuke --force' again to delete what is left on the backup destination store." Both refusals come before anything is deleted, so nothing is "left", and running nuke again fails the same way. For the missing marker, the warning also contradicts the error's own advice (mount the volume, or run vaultik database delete). The comment above the binding check in the same function says this advice must not follow an error raised before anything is deleted. Acceptable: these two refusals return without the warning, as the binding check does, and the two new tests check that the warning is absent.

Model: opus-5-5

- `NukeRemote` in `internal/vaultik/prune.go`: on the two new refusals (a destination store that cannot be listed, and one without `vaultik-destination.txt` while the local index holds snapshots), nuke still warns "Run 'vaultik remote nuke --force' again to delete what is left on the backup destination store." Both refusals come before anything is deleted, so nothing is "left", and running nuke again fails the same way. For the missing marker, the warning also contradicts the error's own advice (mount the volume, or run `vaultik database delete`). The comment above the binding check in the same function says this advice must not follow an error raised before anything is deleted. Acceptable: these two refusals return without the warning, as the binding check does, and the two new tests check that the warning is absent. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-14 06:21:15 +02:00
clawbot added 1 commit 2026-10-14 06:25:58 +02:00
`remote nuke` took a destination store it could not list, or one
without `vaultik-destination.txt` while the local index held
snapshots, as a warning: it then cleared the local snapshot records,
and for an unplugged volume's empty mount point reported the store
empty and exited zero. Nuke now fails on either before it removes
anything, without its advice to run it again, which would fail the
same way. The bulk remove it runs fails on either too; only a
local-only remove still goes on with a warning. Nuke also deletes each
snapshot's remote metadata before its local record, so a failed delete
keeps the snapshot in the local index rather than leaving it on the
store as a remote-only snapshot.

Model: opus-5-5
clawbot force-pushed issue-292-nuke-keeps-local-index from b674f11819 to 523629f1a8 2026-10-14 06:25:58 +02:00 Compare
Author
Collaborator

Rework:

  • NukeRemote now lists the destination's snapshot metadata next to its binding check, before deleting anything, and returns that error without the advice to run nuke again; this covers both the store that cannot be listed and the missing vaultik-destination.txt. Both new tests check that the advice is absent. The PR body's judgement call is updated to match.
  • Rebased onto the current next.

Model: opus-5-5

Rework: - `NukeRemote` now lists the destination's snapshot metadata next to its binding check, before deleting anything, and returns that error without the advice to run nuke again; this covers both the store that cannot be listed and the missing `vaultik-destination.txt`. Both new tests check that the advice is absent. The PR body's judgement call is updated to match. - Rebased onto the current `next`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-14 06:32:51 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 16b03dfda5 into next 2026-10-14 06:47:40 +02:00
clawbot deleted branch issue-292-nuke-keeps-local-index 2026-10-14 06:47:41 +02:00
Sign in to join this conversation.