[] shard: Exclude object.ErrAlreadyRemoved errors in refillMetabase

Tombstone and "alive" objects can be both stored in BlobStor. They can
appear during iterating in different order. Metabase returns
`ErrAlreadyRemoved` error if object is inhumed.

Ignore `object.ErrAlreadyRemoved` errors of `metabase.Put`in Shard's
`refillMetabase` operation.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-09-14 16:37:09 +03:00 committed by Alex Vanin
parent d938c7267b
commit 504abdda06

View file

@ -116,7 +116,12 @@ func (s *Shard) refillMetabase() error {
}
}
return meta.Put(s.metaBase, obj, blzID)
err := meta.Put(s.metaBase, obj, blzID)
if err != nil && !errors.Is(err, object.ErrAlreadyRemoved) {
return err
}
return nil
})
}