sn/meta: submit only parent object for EC split#4059
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4059 +/- ##
==========================================
+ Coverage 26.79% 26.84% +0.04%
==========================================
Files 687 687
Lines 46575 46612 +37
==========================================
+ Hits 12482 12512 +30
- Misses 32959 32965 +6
- Partials 1134 1135 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@roman-khimov, taking into account this, it means there will be as many objects in meta as there are small splits for REPs plus an object for every EC rule. |
001e9e9 to
a460692
Compare
|
Would like to wait for full tests. |
950bd07 to
afbf11f
Compare
For containers of both types of policies (and for EC-only too) wrong number of placement vectors was used. Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
afbf11f to
a252bfc
Compare
| return true | ||
| } | ||
|
|
||
| // submit meta only for last EC part in every rule |
| } | ||
|
|
||
| tx, dataToSign := objectcore.EncodeChainMetaInfo(len(t.containerNodes.PrimaryCounts()), obj.GetContainerID(), obj.GetID(), firstObj, obj.GetPreviousID(), | ||
| tx, dataToSign := objectcore.EncodeChainMetaInfo(len(t.containerNodes.PrimaryCounts())+len(t.containerNodes.ECRules()), obj.GetContainerID(), obj.GetID(), firstObj, obj.GetPreviousID(), |
There was a problem hiding this comment.
how was this problem discovered?
| default: | ||
| } | ||
|
|
||
| _, repRules, ecRules, err := s.fsChain.SelectContainerNodes(o.GetContainerID()) |
There was a problem hiding this comment.
couldn't they have been taken from cnr?
| return true | ||
| } | ||
|
|
||
| // submit meta only for last EC part in every rule |
There was a problem hiding this comment.
what's so special about the last parity part?
| _, secondMeta := objectcore.EncodeChainMetaInfo(placementVectorsNum, o.GetContainerID(), o.GetID(), firstObj, prevObj, o.PayloadSize(), typ, deleted, locked, secondBlock, s.meta.MagicNumber()) | ||
| _, thirdMeta := objectcore.EncodeChainMetaInfo(placementVectorsNum, o.GetContainerID(), o.GetID(), firstObj, prevObj, o.PayloadSize(), typ, deleted, locked, thirdBlock, s.meta.MagicNumber()) | ||
| var ( | ||
| currentBlock = s.meta.Height() |
There was a problem hiding this comment.
so much code shifts just to pack into var (). I'd do such changes in separate commits
| } else { | ||
| _, firstMeta = objectcore.EncodeChainMetaInfo(placementVectorsNum, cID, oID, firstObj, prevObj, payloadSize, typ, deleted, locked, firstBlock, magic) | ||
| _, secondMeta = objectcore.EncodeChainMetaInfo(placementVectorsNum, cID, oID, firstObj, prevObj, payloadSize, typ, deleted, locked, secondBlock, magic) | ||
| _, thirdMeta = objectcore.EncodeChainMetaInfo(placementVectorsNum, cID, oID, firstObj, prevObj, payloadSize, typ, deleted, locked, thirdBlock, magic) |
There was a problem hiding this comment.
6 very similar lines, so it's hard to me to see the diff. Suggest to either func out or conditionally parameterize args before
| ) | ||
| if mustSignParent(o, ecRules) { | ||
| par := o.Parent() | ||
| if par == nil { |
There was a problem hiding this comment.
inobvious requirement for mustSignParent condition. Suggest to call it as is isLastECPart
No description provided.