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:
@@ -309,11 +309,22 @@ func (v *Vaultik) restoreAllFiles(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
plan, err := newRestorePlan(v.ctx, repos, files, chunkToBlobMap, blobIDToHash)
|
||||
plan, unplanned, err := newRestorePlan(
|
||||
v.ctx, repos, files, chunkToBlobMap, blobIDToHash)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("building restore plan: %w", err)
|
||||
}
|
||||
|
||||
// Ranging over files rather than the map reports them in a stable order.
|
||||
for _, file := range files {
|
||||
if planErr, ok := unplanned[file.ID]; ok {
|
||||
err = v.handleRestoreFileError(plan, opts, result, file, file.ID, planErr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filesByID, totalBytesExpected := indexRestoreFiles(files)
|
||||
|
||||
v.UI.Beginf("Restoring %s files (%s) to %s.",
|
||||
|
||||
Reference in New Issue
Block a user