Skip to content

Commit

Permalink
kvserver: refactor validateReplicationChanges()
Browse files Browse the repository at this point in the history
The function had become very hard to read over time as we started to
support explicit voter<->non-voter promotions/demotions of replicas and
rebalances of replicas within a node. This commit re-writes the func
as a series of disjoint checks, each focussing on a specific class of
invalid changes. This should make the function easier to
understand/debug in the future.

Additionally, this commit also converts `TestValidateReplicationChanges`
to a table-driven test.

Release note: None
  • Loading branch information
aayushshah15 committed Feb 22, 2021
1 parent e924d91 commit 20e1ad9
Show file tree
Hide file tree
Showing 3 changed files with 558 additions and 297 deletions.
Loading

0 comments on commit 20e1ad9

Please sign in to comment.