mirror of
https://github.com/restic/restic.git
synced 2024-12-25 17:27:25 +00:00
prune: Add internal integrity check
After repacking every blob that should be kept must have been repacked. We have seen a few cases in which a single blob went missing, which could have been caused by a bitflip somewhere. This sanity check might help catch some of these cases.
This commit is contained in:
parent
5cbde03eae
commit
d0590b7841
1 changed files with 8 additions and 0 deletions
|
@ -658,6 +658,14 @@ func doPrune(opts PruneOptions, gopts GlobalOptions, repo restic.Repository, pla
|
|||
|
||||
// Also remove repacked packs
|
||||
plan.removePacks.Merge(plan.repackPacks)
|
||||
|
||||
if len(plan.keepBlobs) != 0 {
|
||||
Warnf("%v was not repacked\n\n"+
|
||||
"Integrity check failed.\n"+
|
||||
"Please report this error (along with the output of the 'prune' run) at\n"+
|
||||
"https://github.com/restic/restic/issues/new/choose\n", plan.keepBlobs)
|
||||
return errors.Fatal("internal error: blobs were not repacked")
|
||||
}
|
||||
}
|
||||
|
||||
if len(plan.ignorePacks) == 0 {
|
||||
|
|
Loading…
Reference in a new issue