From bc7b49eed23af4b5147745374bc1d9c94630440e Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 8 May 2024 15:03:29 +0300 Subject: [PATCH 1/3] [#82] object: Introduce new fields for EC header * Regenerate protobufs as frostfs-api introduced `parent_split_id` and `parent_split_index` fields. * Fix marshaller and converter for EC header. * Extend v2 type `ECHeader` with `ParentSplitID` and `ParentSplitIndex` fields. * Fix message_test for `Object`. Also generate EC headers and check it. Signed-off-by: Airat Arifullin --- object/convert.go | 4 ++++ object/grpc/service.pb.go | Bin 148314 -> 148482 bytes object/grpc/types.pb.go | Bin 49981 -> 51227 bytes object/marshal.go | 8 ++++++- object/message_test.go | 4 +++- object/test/generate.go | 44 +++++++++++++++++++++++++++----------- object/types.go | 14 ++++++------ 7 files changed, 54 insertions(+), 20 deletions(-) diff --git a/object/convert.go b/object/convert.go index f19cc09..5b4acda 100644 --- a/object/convert.go +++ b/object/convert.go @@ -269,6 +269,8 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message { m = new(object.Header_EC) m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID) + m.ParentSplitId = h.ParentSplitID + m.ParentSplitIndex = h.ParentSplitIndex m.Index = h.Index m.Total = h.Total m.Header = h.Header @@ -300,6 +302,8 @@ func (h *ECHeader) FromGRPCMessage(m grpc.Message) error { } } + h.ParentSplitID = v.GetParentSplitId() + h.ParentSplitIndex = v.GetParentSplitIndex() h.Index = v.GetIndex() h.Total = v.GetTotal() h.Header = v.GetHeader() diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 2bfb50bc985ef472d9736ae98b1a7eae5cdcf766..75d359e9ab984896c3739f747c73fb16f8eb3b2f 100644 GIT binary patch delta 185 zcmXwyu?oU46h(2YUvUR<(sp+h2PeTW6E3Q*$OtpqDTl>){utbz5;YW5a+pqB67acb_a1-%+Wfd z=``tO3#RR_qeQ$eqwv4i7g+j{XNi7np)7O-ql3WJP{t%;l%$W8r6$@#$giP$hHmg) Fe*n;zK&=1( delta 18 acmZqb;JnqwxuNVsv)sq+avvF=1OWh4@(CgU diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 8f4f383cbac718b637f7954ac5a0bbc06faa5532..254e76d54648f5eea7ac4d52b6fc05b6b1be79a5 100644 GIT binary patch delta 1417 zcmZ`%U2Icj7|u32*1GJEm32RE-*(uFSh}|CmrWD_k&uNMFiOa5&e~JjQO_wor?9|~ z7#4&X+S-S$uH8?&5$^=eOhh6mCjML)6K^zLEShkkiHV>WTnTvI?`*@wcysc-@AJOT z&-b01=Zmt*q7Qx@I%{rkXFFA<1tq3LLq|h0Q-((*pTTaOke{hRB^LG*wJK@) z{2+ILPYyoaZUJm*%^{1gODh7asI|FdVTTGn+eF%f2R-{hb z@aUaV{BWuYSL4-%di%jShSQ1CYMn{v_xK(Yxji~jC$`6JMD%T^ezQCZ^QbiNJ@W@_->Ta2V)DFHXfnlY9(r{WeoH&a600&Oo6 z=WMuj;WaEQw&LzgDZa!uf^J`~!~XM4$c0PstbWc-I?;Zq9xqSW2$m=8xO2IOjt!Fn zYE$(%GTBV!@e2dEG*U&!U*6t>CsK8EbcL(S+&zy2y1L<3ok&iV6PlY6(4*S%`;?W+ zg0z4GaWh6UR_sbQ!ZW@RC(`AHaT~5pRbk6`BYsSm7cl&m?kl5r=;o=rI~)vup4f_8 zZyd#|37$Qo+kTL?p>Em%N2UQ5H)R_N(BVE6Qscrn9+jAR6zK9T7w zCVH0}x8H2RUzuKV`2Dzmvu8FUkZq&#QdU4FqYCb;tCzBO zbY&IfWc=jKbxnmFY88?d07X%ai!U61GXt(%zRySpBUZklP7WvBZ kNF8Pt&G=aV5x-unC;mGeFS%k|az`%)63(TQSH5ce2ehZ}Pyhe` delta 778 zcmXYvT}V@L7{*a|VmpqVp&L`r{Ma0J(UQ%kx&DRT)RkmG5)@%2Nf&8;;_QQpWLB1) z?U9^2({nbRTUSPl=sPMBgsgSZjZmzcq8rJZATsFu|LgAj-uHdp^SsYFvQ+duSak3E zF;pHZMfSKZ^QUuDm-%q2u0-E;!d>GDc>I~aBfHBB{oNT7dS7H{XmIlePoT?(dc}r^ z6Sa69E63SsJwgLcypu}N8!Lln)`C}Ktymha)^%$Fc)~l-6Vc;zkAw61X+@3@T)ycn zXh2S)0wXGCDv%4cVf!tAp*HYhhTv#OgfwNK_%&Jqf7Ah`pGS7O0(-93<5F-dT2&o# z+>u(0^d@gJJJ^eZ zuxWx4@S$2fi?O#a#|T!h8wz*&upTLgJN^J`vnIOX$1FjyBBFIp^C;Q0OSFr|${j6afp95uag!$a8E1l}unpT1F7&|wJ|SW~ zZpZC}18s1jJ;7rX0_G9|HWOCdpKx(Bh(`4H+OR&j1&8NFZPm~`TNRn7Mn2`?H-n}H z);Y33JJWf1xCh7Q-B-4IjATBa!S)`o{c~BXA z&O<2oTqO(eh3Exl%r`fYBP4MW9i1TR!h9gcS(;`Nr0 Date: Wed, 8 May 2024 15:07:13 +0300 Subject: [PATCH 2/3] [#82] object: Erase field `Signature` from `ECHeader` v2 type * The field `Signature` is not used and should be factored out. Signed-off-by: Airat Arifullin --- object/types.go | 1 - 1 file changed, 1 deletion(-) diff --git a/object/types.go b/object/types.go index 78c8d43..c9a0519 100644 --- a/object/types.go +++ b/object/types.go @@ -47,7 +47,6 @@ type ECHeader struct { Total uint32 Header []byte HeaderLength uint32 - Signature []byte } type Header struct { -- 2.45.2 From 4fe42ac4add113eb1c634fe7668a1f3c1a5d9137 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 13 May 2024 17:03:55 +0300 Subject: [PATCH 3/3] [#82] object: Add `FilterHeaderECParent` filter for v2 * `FilterHeaderECParent` is used by `Object.Search` Signed-off-by: Airat Arifullin --- object/filters.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/filters.go b/object/filters.go index 5eee13b..9fe024d 100644 --- a/object/filters.go +++ b/object/filters.go @@ -36,6 +36,9 @@ const ( // FilterHeaderSplitID is a filter key to "split.splitID" field of the object header. FilterHeaderSplitID = ReservedFilterPrefix + "split.splitID" + + // FilterHeaderECParent is a filter key to "ec.parent" field of the object header. + FilterHeaderECParent = ReservedFilterPrefix + "ec.parent" ) const ( -- 2.45.2