Skip to content

Commit cedad11

Browse files
committed
kvserver: simplify logging in maybeEnqueueProblemRange
This commit simplifies the logging in `maybeEnqueueProblemRange` to log two booleans directly.
1 parent 9790d74 commit cedad11

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pkg/kv/kvserver/replica.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,15 +2930,8 @@ func (r *Replica) maybeEnqueueProblemRange(
29302930
if !isLeaseholder || !leaseValid {
29312931
// The replicate queue will not process the replica without a valid lease.
29322932
// Track when we skip enqueuing for these reasons.
2933-
boolToInt := func(b bool) int {
2934-
if b {
2935-
return 1
2936-
}
2937-
return 0
2938-
}
2939-
reasons := []string{"is not the leaseholder", "the lease is not valid"}
2940-
reason := reasons[boolToInt(isLeaseholder)]
2941-
log.KvDistribution.VInfof(ctx, 1, "not enqueuing replica %s because %s", r.Desc(), reason)
2933+
log.KvDistribution.Infof(ctx, "not enqueuing replica %s because isLeaseholder=%t, leaseValid=%t",
2934+
r.Desc(), isLeaseholder, leaseValid)
29422935
r.store.metrics.DecommissioningNudgerNotLeaseholderOrInvalidLease.Inc(1)
29432936
return
29442937
}

0 commit comments

Comments
 (0)