cherrypick-2.0: config/storage: per-replica constraints, improved locality handling #22906
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.
This creates a new allowable format for zone config constraints, which
lets the user apply different sets of constraints to different numbers
of replicas within a zone. See the included tests for what the new format
looks like.
Fixes #19985
It also improves the handling of localities that are more or less full
than one another for some reason outside the system's control (e.g. if
one has more nodes than the others or if some constraints have required
more ranges to be in one). In such cases, this does a better job of
balancing ranges amongst the nodes that are more or less full because we
compare them amongst each other now rather than comparing them to the
StoreList averages of all the stores in the cluster.
Fixes #20751
This also deprecates positive (non-required, non-prohibited) constraints.
New positive constraints cannot be set, and existing positive
constraints will be ignored.
Release note (cli change): Replication zone constraints can now be
specified on a per-replica basis, meaning you can configure some
replicas in a zone's ranges to follow one set of constraints and other
replicas to follow other constraints.
Release note (backwards-incompatible change): Positive constraints in
replication zone configs no longer work. They have never been
documented or officially supported, but will no longer be allowed at
all. Any existing positive constraints will be ignored.
Cherry-picks #22412/#22819 into the release-2.0 branch.
@cockroachdb/release