kvserver/allocator: remove dupe logging and fix load delta min #98866
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the store rebalancer would log
load-based replica transfers successfully brought...
even the store was not below the max threshold.The store rebalancer also logs when there are no available replica
rebalancing actions remaining but the store still above the desired load
threshold:
ran out of replicas worth transferring and load
. This logline was duplicated in both the post range rebalancing phase and in
exiting the range rebalancing phase.
This commit stops duplication by removing the exit log line and ensures
that the
load-based replica transfers successfully brought...
log lineoccurs only when actually successful.
There were a few references to old variable values, or in terms of QPS
in the load based best target logic. The logic also was duplicate and
non-uniform in approach. The domain store list was also incorrectly
including all stores in the store map passed in, which is incorrect as
the domain of possible stores should be just the candidate+existing
stores. The domain store list is used to calculate the mean, so
including additional stores that are not candidates (only occurred for
lease transfers) results in a poor comparison point.
This commit updates the comments within
bestStoreToMinimizeDelta
to bemore accurate. The logic is also slightly updated to reuse functions.
This function is one of the most important allocator logic for load
based target scoring.
The incorrect store list creation is also updated, so that the store
list contains only the candidate+existing store.
Previously, the store rebalancer would attempt to transfer leases or
relocate replicas of a range so long as the load of the range (estimated
using the local leaseholder replica) was greater than 0.1% of the
store's load.
This commit updates the value to be higher for both lease rebalancing
and range rebalancing, specifically:
lease rebalancing: 0.1% -> 0.5%
range rebalancing: 0.1% -> 2.0%
The documented rationale, as for why these values exist is also the
reason for the increase: decrease unnecessary churn. Only the hottest
ranges are considered, when the impact of a rebalance action for these
ranges is estimated to be less than a small fraction of the store's
total load, it is indicative that the distribution of replica load is
not skewed. Letting the replicate queue balance replica and lease counts
is a better option in such distributions.
Making the minimum for range rebalancing higher is also added, as
multiple replicas for a range is inherently more costly than moving a
lease.
Resolves: #98867
Resolves: #98870
Release note: None