diff --git a/pkg/services/audit/auditor/pop.go b/pkg/services/audit/auditor/pop.go index d6005b023e..4d73385c45 100644 --- a/pkg/services/audit/auditor/pop.go +++ b/pkg/services/audit/auditor/pop.go @@ -1,11 +1,17 @@ package auditor import ( + "github.com/nspcc-dev/neofs-api-go/pkg/client" "github.com/nspcc-dev/neofs-api-go/pkg/netmap" "github.com/nspcc-dev/neofs-api-go/pkg/object" "go.uber.org/zap" ) +const ( + hashRangeNumber = 4 + minGamePayloadSize = hashRangeNumber * client.TZSize +) + func (c *Context) executePoP() { c.buildCoverage() @@ -44,7 +50,7 @@ func (c *Context) processObjectPlacement(id *object.ID, nodes netmap.Nodes, repl for i := 0; !optimal && ok < replicas && i < len(nodes); i++ { // try to get object header from node - _, err := c.cnrCom.GetHeader(c.task, nodes[i], id) + hdr, err := c.cnrCom.GetHeader(c.task, nodes[i], id) if err != nil { c.log.Debug("could not get object header from candidate", zap.Stringer("id", id), @@ -54,12 +60,19 @@ func (c *Context) processObjectPlacement(id *object.ID, nodes netmap.Nodes, repl continue } + c.updateHeadResponses(hdr) + // increment success counter ok++ // update optimal flag optimal = ok == replicas && uint32(i) < replicas + // exclude small objects from coverage + if c.objectSize(id) < minGamePayloadSize { + continue + } + // update potential candidates to be paired if _, ok := c.pairedNodes[nodes[i].Hash()]; !ok { if unpairedCandidate1 < 0 {