songnon commented on code in PR #13451: URL: https://github.com/apache/kafka/pull/13451#discussion_r1436331091
########## core/src/test/scala/unit/kafka/controller/ControllerIntegrationTest.scala: ########## @@ -572,6 +572,48 @@ class ControllerIntegrationTest extends QuorumTestHarness { "failed to remove reassign partitions path after completion") } + @Test + def testAutoPreferredReplicaLeaderElectionFollowedByAnotherNewReassignment(): Unit = { + servers = makeServers(4, autoLeaderRebalanceEnable = true) + val controller = getController().kafkaController + val tp = new TopicPartition("t", 0) + val assignment = Map(tp.partition -> Seq(0, 2)) + TestUtils.createTopic(zkClient, tp.topic, partitionReplicaAssignment = assignment, servers = servers) + + // Shutdown broker 2 and reassign partition tp from [0, 2] to [1, 0, 2] to create a stuck reassignment. Review Comment: In order to reproduce this issue, broker (0,1) should be always in the replica set. Maybe it's easier to start with replicas (0, 2, 4) instead of (0, 2), so that the replication factor is always 3. Code has been updated. Could you help to take a look? 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