[#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

@ -59,7 +59,8 @@ func (r *RngRes) Object() *object.Object {
// Returns ErrNotFound if requested object is missing in local storage. // Returns ErrNotFound if requested object is missing in local storage.
func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) { func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) {
var ( var (
obj *object.Object obj *object.Object
siErr *objectSDK.SplitInfoError
outError = object.ErrNotFound outError = object.ErrNotFound
) )
@ -74,7 +75,9 @@ func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) {
switch { switch {
case errors.Is(err, object.ErrNotFound): case errors.Is(err, object.ErrNotFound):
return false // ignore, go to next shard 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 outError = err
return true // stop, return it back return true // stop, return it back