From 54b2c15b6424f61c4356161bb7249ff5c447d824 Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Wed, 21 Feb 2024 18:16:59 +0000 Subject: [PATCH] kv: don't log on lease extension while draining Fixes #119451. This commit updates the logging in `Replica.leasePostApplyLocked` to not log on expiration-based lease extensions while the new leaseholder's store is draining. We now only log when a draining store receives a new lease. Release note: None --- pkg/kv/kvserver/replica_proposal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kv/kvserver/replica_proposal.go b/pkg/kv/kvserver/replica_proposal.go index 9787a85348f2..ce38ea7572dc 100644 --- a/pkg/kv/kvserver/replica_proposal.go +++ b/pkg/kv/kvserver/replica_proposal.go @@ -272,7 +272,7 @@ func (r *Replica) leasePostApplyLocked( // Log lease acquisitions loudly when verbose logging is enabled or when the // new leaseholder is draining, in which case it should be shedding leases. // Otherwise, log a trace event. - if log.V(1) || r.store.IsDraining() { + if log.V(1) || (leaseChangingHands && r.store.IsDraining()) { log.Infof(ctx, "new range lease %s following %s", newLease, prevLease) } else { log.Eventf(ctx, "new range lease %s following %s", newLease, prevLease)