[#236] engine: Stop shard iteration at split info error in GetRange

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-08 12:47:05 +03:00
parent 590745204c
commit c267a08886

View file

@ -60,6 +60,7 @@ func (r *RngRes) Object() *object.Object {
func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) {
var (
obj *object.Object
siErr *objectSDK.SplitInfoError
outError = object.ErrNotFound
)
@ -74,7 +75,9 @@ func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) {
switch {
case errors.Is(err, object.ErrNotFound):
return false // ignore, go to next shard
case errors.Is(err, object.ErrAlreadyRemoved):
case
errors.Is(err, object.ErrAlreadyRemoved),
errors.As(err, &siErr):
outError = err
return true // stop, return it back