diff --git a/go.sum b/go.sum index 5ba29c188e..60b2b66b97 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/services/audit/auditor/context.go b/pkg/services/audit/auditor/context.go index 282c17f997..2ac379c869 100644 --- a/pkg/services/audit/auditor/context.go +++ b/pkg/services/audit/auditor/context.go @@ -29,6 +29,8 @@ type Context struct { placementCache map[string][]netmap.Nodes + porRequests, porRetries uint32 + pairs []gamePair pairedMtx sync.Mutex diff --git a/pkg/services/audit/auditor/por.go b/pkg/services/audit/auditor/por.go index 59d29f647d..7159931354 100644 --- a/pkg/services/audit/auditor/por.go +++ b/pkg/services/audit/auditor/por.go @@ -14,6 +14,7 @@ func (c *Context) executePoR() { for i, sg := range c.task.StorageGroupList() { c.checkStorageGroupPoR(i, sg) // consider parallel it } + c.report.SetPoRCounters(c.porRequests, c.porRetries) } func (c *Context) checkStorageGroupPoR(ind int, sg *object.ID) { @@ -52,15 +53,18 @@ func (c *Context) checkStorageGroupPoR(ind int, sg *object.ID) { flat[i], flat[j] = flat[j], flat[i] }) - for _, node := range flat { - hdr, err := c.cnrCom.GetHeader(c.task, node, members[i], true) + for i := range flat { + c.porRequests++ + if i > 0 { // in best case audit get object header on first iteration + c.porRetries++ + } + + hdr, err := c.cnrCom.GetHeader(c.task, flat[i], members[i], true) if err != nil { c.log.Debug("can't head object", - zap.String("remote_node", node.Address()), + zap.String("remote_node", flat[i].Address()), zap.Stringer("oid", members[i])) - // todo: count all fails and successes for audit report - continue } diff --git a/pkg/services/audit/report.go b/pkg/services/audit/report.go index 2a5083837e..c41d0c0161 100644 --- a/pkg/services/audit/report.go +++ b/pkg/services/audit/report.go @@ -60,3 +60,9 @@ func (r *Report) SetPDPResults(passed, failed [][]byte) { r.res.SetPassNodes(passed) r.res.SetFailNodes(failed) } + +// SetPoRCounters sets amounts of head requests and retries at PoR audit stage. +func (r *Report) SetPoRCounters(requests, retries uint32) { + r.res.SetRequests(requests) + r.res.SetRetries(retries) +}