From c267a08886877e63bd42584d835eaf6294a91186 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 8 Dec 2020 12:47:05 +0300 Subject: [PATCH] [#236] engine: Stop shard iteration at split info error in GetRange Signed-off-by: Alex Vanin --- pkg/local_object_storage/engine/range.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/engine/range.go b/pkg/local_object_storage/engine/range.go index f7ccdb67e..d5484c2d3 100644 --- a/pkg/local_object_storage/engine/range.go +++ b/pkg/local_object_storage/engine/range.go @@ -59,7 +59,8 @@ func (r *RngRes) Object() *object.Object { // Returns ErrNotFound if requested object is missing in local storage. func (e *StorageEngine) GetRange(prm *RngPrm) (*RngRes, error) { var ( - obj *object.Object + 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