-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
I3Minimal impactMinimal impactS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityneofs-storageStorage node application issuesStorage node application issues
Description
Is your feature request related to a problem? Please describe.
with #3570, EC policies became available, but mutually exclusive w/ REP ones. It can make sense to support container policies having both EC and REP encoding/placement rules
Describe the solution you'd like
Now
drop IR condition
mostly, code is already ok to work w/ both lists. But not everywhere. Two definite places i know are
neofs-node/pkg/services/object/put/distributed.go
Lines 174 to 198 in 1869725
| repRules := t.containerNodes.PrimaryCounts() | |
| if len(repRules) > 0 { | |
| typ := obj.Type() | |
| broadcast := typ == objectSDK.TypeTombstone || typ == objectSDK.TypeLink || (!t.localOnly && typ == objectSDK.TypeLock) || len(obj.Children()) > 0 | |
| return t.distributeObject(obj, objMeta, encObj, func(obj objectSDK.Object, objMeta object.ContentMeta, encObj encodedObject) error { | |
| return t.placementIterator.iterateNodesForObject(obj.GetID(), repRules, objNodeLists, broadcast, func(node nodeDesc) error { | |
| return t.sendObject(obj, objMeta, encObj, node) | |
| }) | |
| }) | |
| } | |
| if ecRules := t.containerNodes.ECRules(); len(ecRules) > 0 { | |
| if t.ecPart.RuleIndex >= 0 { // already encoded EC part | |
| total := int(ecRules[t.ecPart.RuleIndex].DataPartNum + ecRules[t.ecPart.RuleIndex].ParityPartNum) | |
| nodes := objNodeLists[len(repRules)+t.ecPart.RuleIndex] | |
| return t.saveECPart(obj, objMeta, encObj, t.ecPart.Index, total, nodes) | |
| } | |
| if t.sessionSigner != nil { | |
| if err := t.ecAndSaveObject(t.sessionSigner, obj, ecRules, objNodeLists[len(repRules):]); err != nil { | |
| return err | |
| } | |
| } | |
| } | |
neofs-node/pkg/services/policer/check.go
Lines 121 to 125 in 1869725
| if ecp.RuleIndex >= 0 { | |
| if len(ecRules) > 0 { | |
| p.processECPart(ctx, addr, ecp, ecRules, nn[len(repRules):]) | |
| return | |
| } |
for analysis, look for https://pkg.go.dev/github.com/nspcc-dev/neofs-sdk-go/netmap#NetMap.ContainerNodes calls
Then
explore possible optimizations for rules' processing. For example, handling GET is likely more efficient via REP rules initially
Additional context
Metadata
Metadata
Assignees
Labels
I3Minimal impactMinimal impactS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityneofs-storageStorage node application issuesStorage node application issues