diff --git a/pkg/innerring/processors/audit/process.go b/pkg/innerring/processors/audit/process.go index c3a78fa77..0138c40d4 100644 --- a/pkg/innerring/processors/audit/process.go +++ b/pkg/innerring/processors/audit/process.go @@ -118,9 +118,9 @@ func (ap *Processor) findStorageGroups(cid *cid.ID, shuffled netmap.Nodes) []*ob zap.Int("total_tries", ln), ) - var netAddr network.Address + var netAddr network.AddressGroup - err := netAddr.FromString(shuffled[i].Address()) + err := netAddr.FromIterator(shuffled[i]) if err != nil { log.Warn("can't parse remote address", zap.String("error", err.Error())) diff --git a/pkg/innerring/processors/audit/processor.go b/pkg/innerring/processors/audit/processor.go index 113c96710..f10b78267 100644 --- a/pkg/innerring/processors/audit/processor.go +++ b/pkg/innerring/processors/audit/processor.go @@ -26,7 +26,7 @@ type ( // NeoFSClientCache is an interface for cache of neofs RPC clients NeoFSClientCache interface { - Get(address network.Address) (SDKClient.Client, error) + Get(network.AddressGroup) (SDKClient.Client, error) } TaskManager interface { diff --git a/pkg/innerring/rpc.go b/pkg/innerring/rpc.go index 584bb9301..be0158d29 100644 --- a/pkg/innerring/rpc.go +++ b/pkg/innerring/rpc.go @@ -49,10 +49,10 @@ func newClientCache(p *clientCacheParams) *ClientCache { } } -func (c *ClientCache) Get(address network.Address) (client.Client, error) { +func (c *ClientCache) Get(address network.AddressGroup) (client.Client, error) { // Because cache is used by `ClientCache` exclusively, // client will always have valid key. - return c.cache.Get(network.GroupFromAddress(address)) + return c.cache.Get(address) } // GetSG polls the container from audit task to get the object by id. @@ -75,9 +75,9 @@ func (c *ClientCache) getSG(ctx context.Context, addr *object.Address, nm *netma getParams.WithAddress(addr) for _, node := range placement.FlattenNodes(nodes) { - var netAddr network.Address + var netAddr network.AddressGroup - err := netAddr.FromString(node.Address()) + err := netAddr.FromIterator(node) if err != nil { c.log.Warn("can't parse remote address", zap.String("address", node.Address()), @@ -89,7 +89,6 @@ func (c *ClientCache) getSG(ctx context.Context, addr *object.Address, nm *netma cli, err := c.Get(netAddr) if err != nil { c.log.Warn("can't setup remote connection", - zap.Stringer("address", netAddr), zap.String("error", err.Error())) continue @@ -139,11 +138,11 @@ func (c *ClientCache) GetHeader(task *audit.Task, node *netmap.Node, id *object. headParams.WithMainFields() headParams.WithAddress(objAddress) - var netAddr network.Address + var netAddr network.AddressGroup - err := netAddr.FromString(node.Address()) + err := netAddr.FromIterator(node) if err != nil { - return nil, fmt.Errorf("can't parse remote address %s: %w", node.Address(), err) + return nil, fmt.Errorf("can't parse remote address: %w", err) } cli, err := c.Get(netAddr) @@ -177,11 +176,11 @@ func (c *ClientCache) GetRangeHash(task *audit.Task, node *netmap.Node, id *obje rangeParams.WithRangeList(rng) rangeParams.WithSalt(nil) // it MUST be nil for correct hash concatenation in PDP game - var netAddr network.Address + var netAddr network.AddressGroup - err := netAddr.FromString(node.Address()) + err := netAddr.FromIterator(node) if err != nil { - return nil, fmt.Errorf("can't parse remote address %s: %w", node.Address(), err) + return nil, fmt.Errorf("can't parse remote address: %w", err) } cli, err := c.Get(netAddr)