showuon commented on code in PR #14428: URL: https://github.com/apache/kafka/pull/14428#discussion_r1343475329
########## raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java: ########## @@ -485,6 +485,49 @@ public void testHandleBeginQuorumEpochAfterUserInitiatedResign() throws Exceptio context.listener.currentLeaderAndEpoch()); } + @Test + public void testLeaderShouldResignLeadershipIfNotGetFetchRequestFromMajorityVoters() throws Exception { Review Comment: Added a test in `KafkaRaftClientSnapshotTest`. > Can we also tests the opposite. That the leader doesn't resign if the majority of the replicas (including the leader) have fetch in the last fetchTimeoutMs? I didn't follow you. I've verified: ``` - 1/2 fetch time leadership not get reassigned - fetch from one voter --- timer reset --- - 1/2 fetch time leadership not get reassigned - fetch from another voter --- timer reset --- - 1/2 fetch time leadership not get reassigned - fetch from the observer - 1/2 fetch time --- expired --- leadership should get reassigned ``` I think I've verified what you want. Let me know if I need to add other things. Thanks. -- 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