Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-2.1: gossip: avoid allocation of UnresolvedAddr in getNodeIDAddressLocked #30055

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/gossip/gossip.go
Expand Up @@ -1000,13 +1000,13 @@ func (g *Gossip) getNodeIDAddressLocked(nodeID roachpb.NodeID) (*util.Unresolved
if err != nil {
return nil, err
}
address := &nd.Address
for _, locality := range nd.LocalityAddress {
for i := range nd.LocalityAddress {
locality := &nd.LocalityAddress[i]
if _, ok := g.localityTierMap[locality.LocalityTier.String()]; ok {
return &locality.Address, nil
}
}
return address, nil
return &nd.Address, nil
}

// AddInfo adds or updates an info object. Returns an error if info
Expand Down