From cda1c5b40d0ee379eae04277ee9e063cac17b242 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 9 Jan 2025 13:21:34 +0300 Subject: [PATCH] [#xx] object: Store EC chunk's parent parent's attributes 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 --- object/erasurecode/split.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/object/erasurecode/split.go b/object/erasurecode/split.go index bd173a7..7437c66 100644 --- a/object/erasurecode/split.go +++ b/object/erasurecode/split.go @@ -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)))