diff --git a/pkg/local_object_storage/metabase/put.go b/pkg/local_object_storage/metabase/put.go index 28f12851f..28a15eeca 100644 --- a/pkg/local_object_storage/metabase/put.go +++ b/pkg/local_object_storage/metabase/put.go @@ -251,19 +251,11 @@ func putUniqueIndexes( } // index root object - if obj.Type() == objectSDK.TypeRegular && !obj.HasParent() { - var ( - err error - splitInfo []byte - ) - - if isParent { - splitInfo, err = si.Marshal() - if err != nil { - return fmt.Errorf("can't marshal split info: %w", err) - } + if obj.Type() == objectSDK.TypeRegular && !obj.HasParent() && isParent { + splitInfo, err := si.Marshal() + if err != nil { + return fmt.Errorf("can't marshal split info: %w", err) } - err = putUniqueIndexItem(tx, namedBucketItem{ name: rootBucketName(cnr, bucketName), key: objKey, diff --git a/pkg/local_object_storage/metabase/select_test.go b/pkg/local_object_storage/metabase/select_test.go index e107085ab..ea7a4d126 100644 --- a/pkg/local_object_storage/metabase/select_test.go +++ b/pkg/local_object_storage/metabase/select_test.go @@ -194,7 +194,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) { fs := objectSDK.SearchFilters{} fs.AddRootFilter() testSelect(t, db, cnr, fs, - object.AddressOf(small), + // object.AddressOf(small), object.AddressOf(parent), )