storage: Return soft err when sector alloc fails in acquire (#11350)

Co-authored-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Phi-rjan 2023-10-24 20:12:06 +01:00 committed by GitHub
parent 991cc473f8
commit 2451469558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -548,7 +548,7 @@ func (st *Local) AcquireSector(ctx context.Context, sid storiface.SectorRef, exi
}
if best == "" {
return storiface.SectorPaths{}, storiface.SectorPaths{}, xerrors.Errorf("couldn't find a suitable path for a sector")
return storiface.SectorPaths{}, storiface.SectorPaths{}, storiface.Err(storiface.ErrTempAllocateSpace, xerrors.Errorf("couldn't find a suitable path for a sector"))
}
storiface.SetPathByType(&out, fileType, best)

View File

@ -232,6 +232,7 @@ func retrySoftErr(ctx context.Context, cb func() error) error {
fallthrough
case storiface.ErrTempAllocateSpace:
// retry
log.Errorw("retrying soft error", "err", err, "code", cerr.ErrCode())
default:
// non-temp error
return err