hachikuji opened a new pull request #11186:
URL: https://github.com/apache/kafka/pull/11186


   This patch fixes several problems with the `ElectLeaders` API in KRaft:
   
   - `KafkaApis` did not properly forward this request type to the controller.
   - `ControllerApis` did not handle the request type.
   - `ElectLeadersRequest.getErrorResponse` may raise NPE when 
`TopicPartitions` is null.
   - Controller should not do preferred election if `ElectLeaders` specifies 
`UNCLEAN` election.
   - Controller should not do unclean election if `ElectLeaders` specifies 
`PREFERRED` election.
   
   To test this patch, I have converted `LeaderElectionCommandTest` to use 
KRaft. These test cases are flaky at the moment because of 
https://issues.apache.org/jira/browse/KAFKA-13161, so we will need to merge 
that patch first. Additionally, I've implemented a workaround for 
https://issues.apache.org/jira/browse/KAFKA-13173, so this patch should 
probably also follow that one. I have also added test coverage to 
`KafkaApisTest` and `ControllerApisTest` for the fixed behavior and I have 
added some tests to `ReplicationControlManagerTest` for uncleaned election.
   
   ### 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