From 27caa8a72f68924721496be17d549e2325b0d081 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 17 Jul 2024 16:48:10 +0300 Subject: [PATCH] [#1256] metabase: Put split parent object ID for EC chunks It is required to save split parent ID too, not only split ID. Otherwise inhume operation works incorrect: shard with last part may be skipped and parent object will be available. Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/metabase/put.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/local_object_storage/metabase/put.go b/pkg/local_object_storage/metabase/put.go index ceb79758..f351cb48 100644 --- a/pkg/local_object_storage/metabase/put.go +++ b/pkg/local_object_storage/metabase/put.go @@ -356,6 +356,18 @@ func updateListIndexes(tx *bbolt.Tx, obj *objectSDK.Object, f updateIndexItemFun return err } } + + if parentSplitParentID := ech.ParentSplitParentID(); parentSplitParentID != nil { + objKey := objectKey(ech.Parent(), make([]byte, objectKeySize)) + err := f(tx, namedBucketItem{ + name: parentBucketName(cnr, bucketName), + key: objectKey(*parentSplitParentID, make([]byte, objectKeySize)), + val: objKey, + }) + if err != nil { + return err + } + } } return nil