-
Notifications
You must be signed in to change notification settings - Fork 4k
kvserver: small changes #152508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvserver: small changes #152508
Conversation
|
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
1576079 to
5579035
Compare
arulajmani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arulajmani reviewed 2 of 2 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 1 of 1 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @tbg)
-- commits line 33 at r5:
Did you mean to keep this fixup?
pkg/kv/kvserver/queue.go line 776 at r4 (raw file):
if pqLen := bq.mu.priorityQ.Len(); pqLen > bq.maxSize { replicaItemToDrop := bq.mu.priorityQ.sl[pqLen-1] log.Dev.VInfof(ctx, 1, "dropping due to exceeding queue max size: priority=%0.3f, replica=%v",
nit: Should this be in KVDistribution?
|
Previously, arulajmani (Arul Ajmani) wrote…
Hm, was wondering abt this as well. But other logs in this file use |
This commit refactors isDecommissionAction into allocatorimpl for consistency
with other similar helpers like allocatorActions.{Add,Replace,Remove}. This
change has no behavior changes but to make future commits easier.
This commit simplifies the logging in `maybeEnqueueProblemRange` to log two booleans directly.
Previously, the comment on the queue incorrectly stated that it removes the lowest-priority element when exceeding its maximum size. This was misleading because heap only guarantees that the root is the highest priority, not that elements are globally ordered. This commit updates the comment to clarify that the removed element might not be the lowest priority. Ideally, we should drop the lowest priority element when exceeding queue size, but heap doesn't make this very easy.
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.
|
Rebased on master and picked up the fixup. |
|
TFTR! bors r=arulajmani |
Epic: none
Release note: none
allocator: move isDecommissionAction to allocatorimpl
This commit refactors isDecommissionAction into allocatorimpl for consistency
with other similar helpers like allocatorActions.{Add,Replace,Remove}. This
change has no behavior changes but to make future commits easier.
kvserver: simplify logging in maybeEnqueueProblemRange
This commit simplifies the logging in
maybeEnqueueProblemRangeto log twobooleans directly.
kvserver: fix comment when dropping due to exceeding size
Previously, the comment on the queue incorrectly stated that it removes the
lowest-priority element when exceeding its maximum size. This was misleading
because heap only guarantees that the root is the highest priority, not that
elements are globally ordered. This commit updates the comment to clarify that
the removed element might not be the lowest priority. Ideally, we should drop
the lowest priority element when exceeding queue size, but heap doesn't make
this very easy.
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.