Restore the other files when a chunk is in no blob under --skip-errors (closes #326)
check / check (push) Successful in 18m23s
check / check (push) Successful in 18m23s
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
This commit was merged in pull request #361.
This commit is contained in:
1 parent
bffd4578fc
commit
e48bafccef
4 files changed
+138
-29
No files matched your search
@@ -61,8 +61,8 @@ func craftedFile(
|
||||
}
|
||||
|
||||
// TestRestoreShortChunkHashInNoBlob proves a file whose short chunk hash
|
||||
// has no blob_chunks row fails restore planning and the chunk write with
|
||||
// an error.
|
||||
// has no blob_chunks row is left out of the restore plan with an error,
|
||||
// and fails the chunk write with an error.
|
||||
func TestRestoreShortChunkHashInNoBlob(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -77,9 +77,11 @@ func TestRestoreShortChunkHashInNoBlob(t *testing.T) {
|
||||
chunkToBlobMap, err := v.buildChunkToBlobMap(ctx, repos)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = newRestorePlan(ctx, repos, []*database.File{file},
|
||||
plan, unplanned, err := newRestorePlan(ctx, repos, []*database.File{file},
|
||||
chunkToBlobMap, map[string]string{})
|
||||
require.ErrorIs(t, err, errPlanChunkMissing)
|
||||
require.NoError(t, err)
|
||||
require.ErrorIs(t, unplanned[file.ID], errPlanChunkMissing)
|
||||
require.False(t, plan.hasPending())
|
||||
|
||||
fileChunks, err := repos.FileChunks.GetByFileID(ctx, file.ID)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user