forked from TrueCloudLab/frostfs-node
[#238] engine: Stop shard iteration at split info error in Head
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
69dee6ec6d
commit
da42ee3a26
1 changed files with 5 additions and 2 deletions
|
@ -44,7 +44,8 @@ func (r *HeadRes) Header() *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) Head(prm *HeadPrm) (*HeadRes, error) {
|
func (e *StorageEngine) Head(prm *HeadPrm) (*HeadRes, error) {
|
||||||
var (
|
var (
|
||||||
head *object.Object
|
head *object.Object
|
||||||
|
siErr *objectSDK.SplitInfoError
|
||||||
|
|
||||||
outError = object.ErrNotFound
|
outError = object.ErrNotFound
|
||||||
)
|
)
|
||||||
|
@ -58,7 +59,9 @@ func (e *StorageEngine) Head(prm *HeadPrm) (*HeadRes, 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
|
||||||
|
|
Loading…
Reference in a new issue