Skip to content

Commit ed6c55e

Browse files
committed
kvserver: add logging for ranges dropped from base queue
This commit adds logging for ranges dropped from the base queue due to exceeding max size, improving observability. The log is gated behind V(1) to avoid verbosity on nodes with many ranges.
1 parent 8c80097 commit ed6c55e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/kv/kvserver/queue.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,10 @@ func (bq *baseQueue) addInternal(
772772
// priority element, but it would require additional bookkeeping or a linear
773773
// scan.
774774
if pqLen := bq.mu.priorityQ.Len(); pqLen > bq.maxSize {
775-
bq.removeLocked(bq.mu.priorityQ.sl[pqLen-1])
775+
replicaItemToDrop := bq.mu.priorityQ.sl[pqLen-1]
776+
log.Dev.VInfof(ctx, 1, "dropping due to exceeding queue max size: priority=%0.3f, replica=%v",
777+
priority, replicaItemToDrop.replicaID)
778+
bq.removeLocked(replicaItemToDrop)
776779
}
777780
// Signal the processLoop that a replica has been added.
778781
select {

0 commit comments

Comments
 (0)