[#1256] metabase: Put split parent object ID for EC chunks
All checks were successful
DCO action / DCO (pull_request) Successful in 6m13s
Vulncheck / Vulncheck (pull_request) Successful in 6m44s
Tests and linters / gopls check (pull_request) Successful in 9m52s
Build / Build Components (1.22) (pull_request) Successful in 10m1s
Build / Build Components (1.21) (pull_request) Successful in 10m33s
Tests and linters / Staticcheck (pull_request) Successful in 11m5s
Pre-commit hooks / Pre-commit (pull_request) Successful in 14m47s
Tests and linters / Lint (pull_request) Successful in 16m21s
Tests and linters / Tests (1.22) (pull_request) Successful in 16m22s
Tests and linters / Tests with -race (pull_request) Successful in 16m32s
Tests and linters / Tests (1.21) (pull_request) Successful in 16m47s

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 <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-07-17 16:48:10 +03:00
parent e83d39e33f
commit 27caa8a72f

View file

@ -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