kevin-wu24 commented on code in PR #18987: URL: https://github.com/apache/kafka/pull/18987#discussion_r1980466623
########## raft/src/test/java/org/apache/kafka/raft/RaftEventSimulationTest.java: ########## @@ -475,6 +537,104 @@ void canRecoverFromSingleNodeCommittedDataLoss( scheduler.runUntil(() -> cluster.allReachedHighWatermark(highWatermarkBeforeRestart + 10)); } + @Property(tries = 100, afterFailure = AfterFailureMode.SAMPLE_ONLY) + void canAddObserverAndRemovePartitionedVoter( + @ForAll int seed, + @ForAll @IntRange(min = 3, max = 5) int numVoters + ) { + Random random = new Random(seed); + Cluster cluster = new Cluster(numVoters, 1, random, true); + MessageRouter router = new MessageRouter(cluster); + EventScheduler scheduler = schedulerWithDefaultInvariants(cluster); + Set<Integer> expectedVoterIds = new HashSet<>(cluster.initialVoters.keySet()); + + initializeClusterAndStartAppending(cluster, router, scheduler, 10); + + // Partition a random voter, and add an observer to replace it + RaftNode voterToRemove = cluster.running.get(random.nextInt(numVoters)); + router.filter(voterToRemove.id(), new DropAllTraffic()); + addVoter(cluster, scheduler, numVoters, expectedVoterIds); Review Comment: see https://github.com/apache/kafka/pull/18987#discussion_r1980455784 -- 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