diff --git a/pkg/kv/transport.go b/pkg/kv/transport.go index fa0a24b70fec..e3ce4e940da2 100644 --- a/pkg/kv/transport.go +++ b/pkg/kv/transport.go @@ -42,7 +42,6 @@ type SendOptions struct { type batchClient struct { remoteAddr string - conn *rpc.Connection args roachpb.BatchRequest healthy bool pending bool @@ -118,15 +117,14 @@ func grpcTransportFactoryImpl( ) (Transport, error) { clients := make([]batchClient, 0, len(replicas)) for _, replica := range replicas { - conn := rpcContext.GRPCDial(replica.NodeDesc.Address.String()) argsCopy := args argsCopy.Replica = replica.ReplicaDescriptor remoteAddr := replica.NodeDesc.Address.String() + healthy := rpcContext.ConnHealth(remoteAddr) == nil clients = append(clients, batchClient{ remoteAddr: remoteAddr, - conn: conn, args: argsCopy, - healthy: rpcContext.ConnHealth(remoteAddr) == nil, + healthy: healthy, }) } @@ -244,7 +242,7 @@ func (gt *grpcTransport) send( } log.VEventf(ctx, 2, "sending request to %s", client.remoteAddr) - conn, err := client.conn.Connect(ctx) + conn, err := gt.rpcContext.GRPCDial(client.remoteAddr).Connect(ctx) if err != nil { return nil, err }