[#799] policer: Refactor method processNodes

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-01-10 15:17:05 +03:00 committed by Evgenii Stratonikov
parent 5be2af881a
commit 6534252c22

View file

@ -132,21 +132,21 @@ func (p *Policer) processNodes(ctx context.Context, requirements *placementRequi
cancel() cancel()
if err == nil {
shortage--
checkedNodes.submitReplicaHolder(nodes[i])
} else {
if client.IsErrObjectNotFound(err) { if client.IsErrObjectNotFound(err) {
checkedNodes.submitReplicaCandidate(nodes[i]) checkedNodes.submitReplicaCandidate(nodes[i])
continue continue
} } else if isClientErrMaintenance(err) {
if isClientErrMaintenance(err) {
shortage, uncheckedCopies = p.handleMaintenance(nodes[i], checkedNodes, shortage, uncheckedCopies) shortage, uncheckedCopies = p.handleMaintenance(nodes[i], checkedNodes, shortage, uncheckedCopies)
} else if err != nil { } else {
p.log.Error(logs.PolicerReceiveObjectHeaderToCheckPolicyCompliance, p.log.Error(logs.PolicerReceiveObjectHeaderToCheckPolicyCompliance,
zap.Stringer("object", addr), zap.Stringer("object", addr),
zap.String("error", err.Error()), zap.String("error", err.Error()),
) )
} else { }
shortage--
checkedNodes.submitReplicaHolder(nodes[i])
} }
} }