From bf59f4065ae4e81bff418021cf879f77ed23d0cd Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Wed, 3 Aug 2022 20:08:47 +0000 Subject: [PATCH] kvserver: don't check ConnHealth when releasing proposal quota The proposal quota release procedure checked node connection health for every node that appears active after replica activity checks. This is expensive, and previously caused issues like #84943. This change removes the ConnHealth check, because other checks, such as isFollowerActiveSince and paused replicas, provide sufficient protection from various kinds of overloads. Release note: None --- pkg/kv/kvserver/replica_proposal_quota.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/kv/kvserver/replica_proposal_quota.go b/pkg/kv/kvserver/replica_proposal_quota.go index a89ee1b805db..00ac28943e01 100644 --- a/pkg/kv/kvserver/replica_proposal_quota.go +++ b/pkg/kv/kvserver/replica_proposal_quota.go @@ -163,11 +163,9 @@ func (r *Replica) updateProposalQuotaRaftMuLocked( ) { return } - - // Only consider followers that that have "healthy" RPC connections. - if err := r.store.cfg.NodeDialer.ConnHealth(rep.NodeID, r.connectionClass.get()); err != nil { - return - } + // At this point, we know that either we communicated with this replica + // recently, or we became the leader recently. The latter case is ambiguous + // w.r.t. the actual state of that replica, but it is temporary. // Note that the Match field has different semantics depending on // the State. @@ -210,7 +208,7 @@ func (r *Replica) updateProposalQuotaRaftMuLocked( if progress.Match > 0 && progress.Match < minIndex { minIndex = progress.Match } - // If this is the most recently added replica and it has caught up, clear + // If this is the most recently added replica, and it has caught up, clear // our state that was tracking it. This is unrelated to managing proposal // quota, but this is a convenient place to do so. if rep.ReplicaID == r.mu.lastReplicaAdded && progress.Match >= commitIndex {