Restore the other files when a chunk is in no blob under --skip-errors #361

Merged
clawbot merged 1 commits from issue-326-skip-errors-chunk-in-no-blob into next 2026-10-13 16:53:06 +02:00
Collaborator

Fixes #326.

What was wrong: restore planning returned an error for the first file that needs a chunk no blob holds, and restoreAllFiles returned it at once. The file never reached handleRestoreFileError, so --skip-errors could not skip it and nothing was restored.

What changed: newRestorePlan now leaves such a file out of the plan and returns it, by file ID, with the reason (errPlanChunkMissing or errPlanBlobIDMissing). restoreAllFiles passes each one, in file order, to handleRestoreFileError before the restore loop starts. Under --skip-errors the file is reported and counted as failed, every other file is restored, and the command exits non-zero. Without the flag the restore still stops before any file is written. A database error while reading a file's chunks still ends planning.

The --skip-errors restore tests now share one backup helper. The new case removes one blob's snapshot_blobs and uploads rows from the local index and exports the snapshot metadata again, then restores with and without SkipErrors.

What a reader might trip over:

  • Without the flag the error changes from building restore plan: planning FILE: ... to the usual restoring FILE: ... (pass --skip-errors to continue past restore failures).
  • Judgement call: these files are reported before the "Restoring N files" line, so that without the flag the restore still stops before it begins.
  • With --verify such a file is reported again by verification: #323.
  • Unverified: the locked make check never got a turn on the shared host, so the reviewer's gate is the first full run on this commit.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/326. **What was wrong:** restore planning returned an error for the first file that needs a chunk no blob holds, and `restoreAllFiles` returned it at once. The file never reached `handleRestoreFileError`, so `--skip-errors` could not skip it and nothing was restored. **What changed:** `newRestorePlan` now leaves such a file out of the plan and returns it, by file ID, with the reason (`errPlanChunkMissing` or `errPlanBlobIDMissing`). `restoreAllFiles` passes each one, in file order, to `handleRestoreFileError` before the restore loop starts. Under `--skip-errors` the file is reported and counted as failed, every other file is restored, and the command exits non-zero. Without the flag the restore still stops before any file is written. A database error while reading a file's chunks still ends planning. The `--skip-errors` restore tests now share one backup helper. The new case removes one blob's `snapshot_blobs` and `uploads` rows from the local index and exports the snapshot metadata again, then restores with and without `SkipErrors`. **What a reader might trip over:** - Without the flag the error changes from `building restore plan: planning FILE: ...` to the usual `restoring FILE: ... (pass --skip-errors to continue past restore failures)`. - Judgement call: these files are reported before the "Restoring N files" line, so that without the flag the restore still stops before it begins. - With `--verify` such a file is reported again by verification: https://git.eeqj.de/sneak/vaultik/issues/323. - Unverified: the locked `make check` never got a turn on the shared host, so the reviewer's gate is the first full run on this commit. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 15:37:03 +02:00
clawbot self-assigned this 2026-10-13 15:37:03 +02:00
clawbot added 1 commit 2026-10-13 15:37:03 +02:00
Restore planning stopped at the first file needing a chunk that no blob
holds, so --skip-errors never saw that file and nothing was restored.
The planner now leaves such a file out of the plan and returns it with
the reason, and each one goes through handleRestoreFileError like any
other failed file: skipped and counted under --skip-errors, fatal
without it. The fatal error now suggests --skip-errors, as other restore
failures do.

The skip-errors tests now share one backup helper; the new case removes
a blob from the snapshot metadata and exports it again.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit e48bafccef into next 2026-10-13 16:53:06 +02:00
clawbot deleted branch issue-326-skip-errors-chunk-in-no-blob 2026-10-13 16:53:06 +02:00
Sign in to join this conversation.