check: verify pack a second time if broken

This commit is contained in:
Michael Eischer 2024-05-09 18:48:22 +02:00
parent 385cee09dc
commit 3ff063e913

View file

@ -725,6 +725,16 @@ func (c *Checker) ReadPacks(ctx context.Context, packs map[restic.ID]int64, p *p
}
err := checkPack(ctx, c.repo, ps.id, ps.blobs, ps.size, bufRd, dec)
if err != nil {
// retry pack verification to detect transient errors
err2 := checkPack(ctx, c.repo, ps.id, ps.blobs, ps.size, bufRd, dec)
if err2 != nil {
err = err2
} else {
err = fmt.Errorf("second check successful, original error %w", err)
}
}
p.Add(1)
if err == nil {
continue