KAFKA-16580: Enable dynamic quorum reconfiguration for raft simulation tests pt 1 #18987
+438
−119
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.
What
voters
fromCluster
, instead this state now is just an accurate view of the initial voters.endpointsFromIds
, which is used to set up network partitions for these tests, cannot rely onvoters
anymore, and must instead useCluster#running
. This means that tests must callCluster#start()
before setting up network partitions.RaftClientTestContext
.MajorityReachedHighWatermark
invariant for KIP-853: since the voter set can change, the size of the majority that needs to reach the HWM also changes. For clusters running in KIP-853 mode, we check that a majority of at least one of: leader's voter set at the HWM or it'slastVoterSet()
, has reached the HWM. We need to perform a more elaborate check here because in clusters where a Add/RemoveVoter request increases/decreases the majority of voters value by 1, the leader could have used either majority value to update its HWM value depending on whether the leader read the most recent VotersRecord prior to updating its HWM value. This matters for invariant checking because we perform this verification on every message delivery.RaftTestUtils
to house shared functions between these simulation tests and existing integration tests.AddVoterAction
andRemoveVoterAction
to add or remove voters within simulation tests.Committer Checklist (excluded from commit message)