[#273] service/audit: Ignore coverage of very small objects
PDP audit check is not quite working with very small objects, so we try to build coverage with bigger objects. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
afb83c610c
commit
6977adec66
1 changed files with 14 additions and 1 deletions
|
@ -1,11 +1,17 @@
|
||||||
package auditor
|
package auditor
|
||||||
|
|
||||||
import (
|
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/netmap"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
hashRangeNumber = 4
|
||||||
|
minGamePayloadSize = hashRangeNumber * client.TZSize
|
||||||
|
)
|
||||||
|
|
||||||
func (c *Context) executePoP() {
|
func (c *Context) executePoP() {
|
||||||
c.buildCoverage()
|
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++ {
|
for i := 0; !optimal && ok < replicas && i < len(nodes); i++ {
|
||||||
// try to get object header from node
|
// 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 {
|
if err != nil {
|
||||||
c.log.Debug("could not get object header from candidate",
|
c.log.Debug("could not get object header from candidate",
|
||||||
zap.Stringer("id", id),
|
zap.Stringer("id", id),
|
||||||
|
@ -54,12 +60,19 @@ func (c *Context) processObjectPlacement(id *object.ID, nodes netmap.Nodes, repl
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.updateHeadResponses(hdr)
|
||||||
|
|
||||||
// increment success counter
|
// increment success counter
|
||||||
ok++
|
ok++
|
||||||
|
|
||||||
// update optimal flag
|
// update optimal flag
|
||||||
optimal = ok == replicas && uint32(i) < replicas
|
optimal = ok == replicas && uint32(i) < replicas
|
||||||
|
|
||||||
|
// exclude small objects from coverage
|
||||||
|
if c.objectSize(id) < minGamePayloadSize {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// update potential candidates to be paired
|
// update potential candidates to be paired
|
||||||
if _, ok := c.pairedNodes[nodes[i].Hash()]; !ok {
|
if _, ok := c.pairedNodes[nodes[i].Hash()]; !ok {
|
||||||
if unpairedCandidate1 < 0 {
|
if unpairedCandidate1 < 0 {
|
||||||
|
|
Loading…
Reference in a new issue