From 18182e578ec55fd035403e3915f5e4f66ad4c8c3 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 22 Jul 2024 13:54:06 +0300 Subject: [PATCH] [#1261] shard: Fix delete objects from FSTree Replace nil storageID with empty like by shard.Get. Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/shard/delete.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/local_object_storage/shard/delete.go b/pkg/local_object_storage/shard/delete.go index 44f6c6b4..c898fdf4 100644 --- a/pkg/local_object_storage/shard/delete.go +++ b/pkg/local_object_storage/shard/delete.go @@ -117,6 +117,12 @@ func (s *Shard) deleteFromBlobstor(ctx context.Context, addr oid.Address) error return err } storageID := res.StorageID() + if storageID == nil { + // if storageID is nil it means: + // 1. there is no such object + // 2. object stored by writecache: should not happen, as `validateWritecacheDoesntContainObject` called before `deleteFromBlobstor` + return nil + } var delPrm common.DeletePrm delPrm.Address = addr