showuon opened a new pull request, #14428:
URL: https://github.com/apache/kafka/pull/14428

   In 
[KIP-595](https://cwiki.apache.org/confluence/display/KAFKA/KIP-595%3A+A+Raft+Protocol+for+the+Metadata+Quorum#KIP595:ARaftProtocolfortheMetadataQuorum-LeaderProgressTimeout),
 we expect to piggy-back on the `quorum.fetch.timeout.ms` config, and if the 
leader did not receive Fetch requests from a majority of the quorum for that 
amount of time, it would begin a new election, to resolve the network partition 
in the quorum. But we missed this implementation in current KRaft. Fixed it in 
this PR.
   
   This PR did:
   1. Added a fetchTimer with fetchTimeout in `LeaderState`, and check if 
expired each time when leader poll. If expired, resigning the leadership and 
start a new election.
   2. Added `fetchedVoters` in `LeaderState`, and update the value each time 
received a fetchRequest, and clear it and reset fetchTimer if the majority of 
fetchRequest received.
   3. Added tests.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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