forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvserver: refactor replicate queue allocator usage logic
This change refactors parts of the replicate queue's `PlanOneChange(..)` and `addOrRemove{Non}Voters(..)` functions to reusable helper functions that simplify usage of the allocator and deduplicate repeated code paths. The change also adds convenience methods to the `AllocatorAction` enum, to move certain determinations (such as if a computed allocator action is a remove or a replace) closer to the allocator type it is based on. These changes move more of the logic needed to use the allocator into the `allocatorimpl` package itself, enabling usage of the allocator outside of the replicate queue. Part of cockroachdb#91571. Release note: None
- Loading branch information
Showing
2 changed files
with
255 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.