-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
release-23.1: kvserver: use qps for hot ranges sorting #100211
Conversation
We introduced CPU balancing by default in #97424. This had the side effect of changing the hot ranges api to return the hottest replicas by CPU, rather than QPS. This patch updates the replica rankings struct to support tracking both by CPU and QPS simultaneously. The hot ranges API collects the top k by QPS and the store rebalancer collects depending on the setting of `kv.allocator.load_based_rebalancing.objective`, which is by default `cpu`. Resolves: #99605 Release note (bug fix): The hot ranges UI page would show hot ranges by CPU and not QPS, depending on the value of `kv.allocator.load_based_rebalancing.objective` (default `cpu`). Now the UI page will always collect based on QPS.
816faba
to
24d06ef
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
@@ -138,23 +143,33 @@ func (rr *ReplicaRankings) TopLoad() []CandidateReplica { | |||
// prevents concurrent loaders of data from messing with each other -- the last | |||
// `update`d accumulator will win. | |||
type RRAccumulator struct { | |||
dim rrPriorityQueue | |||
dims map[load.Dimension]*rrPriorityQueue |
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.
The map here feels heavyweight when we could use a slice like we do in load.Vector
. It doesn't need to be changed here, but consider replacing on master.
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.
Agree - I will change on master.
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.
Perhaps you could try out some generics here with a structure like type load.Map[T any] [nDimensions]T
.
Backport 1/1 commits from #99716 on behalf of @kvoli.
/cc @cockroachdb/release
We introduced CPU balancing by default in #97424. This had the side effect of changing the hot ranges api to return the hottest replicas by CPU, rather than QPS.
This patch updates the replica rankings struct to support tracking both by CPU and QPS simultaneously. The hot ranges API collects the top k by QPS and the store rebalancer collects depending on the setting of
kv.allocator.load_based_rebalancing.objective
, which is by defaultcpu
.Resolves: #99605
Release justification: Fixes hot ranges sorting to always be by QPS for backwards compatibility.