Skip to content

Commit

Permalink
kv: don't log on lease extension while draining
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nvanbenschoten committed Feb 21, 2024
1 parent 0c7c814 commit 54b2c15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/replica_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 54b2c15

Please sign in to comment.