songnon commented on code in PR #12543:
URL: https://github.com/apache/kafka/pull/12543#discussion_r950920059
##########
core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala:
##########
@@ -490,6 +490,41 @@ class ControllerIntegrationTest extends QuorumTestHarness {
"failed to get expected partition state upon broker startup")
}
+ @Test
+ def testAutoPreferredReplicaLeaderElectionWithReassigningPartitions(): Unit
= {
Review Comment:
During a partition's reassignment, if the current leader is not in TRS or
isn't alive, a leader election will be triggered at the time when the TRS =
ISR. At that time, the partition is still in
`controllerContext.partitionsBeingReassigned`, so
`checkAndTriggerAutoLeaderRebalance` will skip that particular partition.
When the reassignment is done (partition being removed from
`controllerContext.partitionsBeingReassigned`),
`checkAndTriggerAutoLeaderRebalance` will treat it as a normal partition,
preferred leader election may be triggered if it's allowed to.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]