[#1613] morph: Add tracing for morph queries to neo-go

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2025-02-05 16:37:11 +03:00
parent 4de5fca547
commit 9b113c3156
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD
120 changed files with 623 additions and 562 deletions

View file

@ -7,6 +7,7 @@ map candidates.
package state
import (
"context"
"errors"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
@ -23,7 +24,7 @@ type NetworkSettings interface {
// no error if allowed;
// ErrMaintenanceModeDisallowed if disallowed;
// other error if there are any problems with the check.
MaintenanceModeAllowed() error
MaintenanceModeAllowed(ctx context.Context) error
}
// NetMapCandidateValidator represents tool which checks state of nodes which
@ -55,13 +56,13 @@ func (x *NetMapCandidateValidator) SetNetworkSettings(netSettings NetworkSetting
// MUST NOT be called before SetNetworkSettings.
//
// See also netmap.NodeInfo.IsOnline/SetOnline and other similar methods.
func (x *NetMapCandidateValidator) VerifyAndUpdate(node *netmap.NodeInfo) error {
func (x *NetMapCandidateValidator) VerifyAndUpdate(ctx context.Context, node *netmap.NodeInfo) error {
if node.Status().IsOnline() {
return nil
}
if node.Status().IsMaintenance() {
return x.netSettings.MaintenanceModeAllowed()
return x.netSettings.MaintenanceModeAllowed(ctx)
}
return errors.New("invalid status: MUST be either ONLINE or MAINTENANCE")