andymg3 opened a new pull request, #13521: URL: https://github.com/apache/kafka/pull/13521
### Description This adds a couple tests. First, it adds a test that makes sure we handle what happens when a reassignment completes and none of the new replicas can be made leader. Its important we dont keep an old replica as leader. Second, it adds a test that makes sure we handle new reassignments that dont include a previous assignment replica that was leader. In the test here (in `testReassignPartitionsKeepsAllPreviousReassigningReplicas`) that replica is broker 2. We first reassign the partition from [0, 1] to [2, 3]. Then elect 2 leader after its joined the ISR. 3 does not join the ISR so the reassignment is not complete. Then we reassign the partition again to [3, 4]. The important part is we arent stuck with 2 being leader and it being removed from the replicas list. In KRaft we dont remove it from the replicas list so its OK it stays as leader. Finally when 3, 4 get added to the ISR it will be demoted and removed from the replicas list. ### 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