From 504abdda06bb6ac977461e1d1c40a0b6cec158b8 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 14 Sep 2021 16:37:09 +0300 Subject: [PATCH] [#789] 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 --- pkg/local_object_storage/shard/control.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index 450afb47..58088c60 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -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 }) }