[#xx] object: Store EC chunk's parent parent's attributes
Some checks failed
DCO / DCO (pull_request) Failing after 26s
Tests and linters / Tests (pull_request) Successful in 50s
Tests and linters / Lint (pull_request) Successful in 2m14s

In FrostFS we can:
- Split a big object into parts: Object -> Parts
- Split an object into chunks: Object -> Chunks
- Do both: Object -> Parts -> Chunks

And object's attributes are propagated in the following way:
- Object (attributes) -> Parts (no attributes)
- Object (attributes) -> Chunks (attributes)
- Object (attributes) -> Parts (no attributes) -> Chunks (no attributes)

As a result, in a FrostFS node, there's no way to determine the expiration epoch
of an expirable regular object. Now attributes are stored in the following way:
- If a chunk's parent has no parent, store chunk's parent's attributes
- If a chunk's parent has a parent, store chunk's parent's parent's attributes

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
Aleksey Savchuk 2025-01-09 13:21:34 +03:00
parent 328d214d2d
commit cda1c5b40d
Signed by: a-savchuk
GPG key ID: 70C0A7FF6F9C4639

View file

@ -33,19 +33,21 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob
chunk.SetPayload(payloadShards[i])
chunk.SetPayloadSize(uint64(len(payloadShards[i])))
attributes := obj.Attributes()
var parentSplitParentID *oid.ID
if obj.HasParent() {
splitParentID, ok := obj.Parent().ID()
if ok {
parentSplitParentID = &splitParentID
}
attributes = obj.Parent().Attributes()
}
ecParentInfo := objectSDK.ECParentInfo{
ID: parent,
SplitID: obj.SplitID(),
SplitParentID: parentSplitParentID,
Attributes: obj.Attributes(),
Attributes: attributes,
}
ec := objectSDK.NewECHeader(ecParentInfo, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header)))