From da42ee3a26455290d95234890a79931fdc27c8da Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 8 Dec 2020 14:43:56 +0300 Subject: [PATCH] [#238] engine: Stop shard iteration at split info error in Head Signed-off-by: Alex Vanin --- pkg/local_object_storage/engine/head.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/engine/head.go b/pkg/local_object_storage/engine/head.go index 1723df5e..a8a12bb5 100644 --- a/pkg/local_object_storage/engine/head.go +++ b/pkg/local_object_storage/engine/head.go @@ -44,7 +44,8 @@ func (r *HeadRes) Header() *object.Object { // Returns ErrNotFound if requested object is missing in local storage. func (e *StorageEngine) Head(prm *HeadPrm) (*HeadRes, error) { var ( - head *object.Object + head *object.Object + siErr *objectSDK.SplitInfoError outError = object.ErrNotFound ) @@ -58,7 +59,9 @@ func (e *StorageEngine) Head(prm *HeadPrm) (*HeadRes, 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