kevin-wu24 commented on code in PR #18987:
URL: https://github.com/apache/kafka/pull/18987#discussion_r1970766229


##########
raft/src/test/java/org/apache/kafka/raft/RaftEventSimulationTest.java:
##########
@@ -487,6 +555,12 @@ private EventScheduler 
schedulerWithDefaultInvariants(Cluster cluster) {
         return scheduler;
     }
 
+    private EventScheduler schedulerWithKip853Invariants(Cluster cluster) {
+        EventScheduler scheduler = schedulerWithDefaultInvariants(cluster);
+        scheduler.addInvariant(new AtMostOneUncommittedVoterSet(cluster));

Review Comment:
   I will have to refactor the `voterSetFromIds()` method to actually return 
something a non-empty optional if we add this invariant for non-KIP-853 tests, 
as that would throw an exception during verification.
   
   My main reason for not adding it initially is that it is trivially invariant 
for a cluster not running in KIP-853 mode, and that under the current 
implementation of the verification, we have to iterate over the offsets in the 
log between the HWM and the offset where the leader's `lastVoterSet()` is. 
Also, the current implementation is slightly confusing, so I'll refactor it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to