jsancio opened a new pull request #9631: URL: https://github.com/apache/kafka/pull/9631
It is possible for the the controller to send LeaderAndIsr requests with an ISR that contains ids not in the replica set. This is used during reassignment so that the partition leader doesn't add replicas back to the ISR. This is needed because the controller updates ZK and the replicas through two rounds: 1. The first round of ZK updates and LeaderAndIsr requests shrinks the ISR. 2. The second round of ZK updates and LeaderAndIsr requests shrinks the replica set. This could be avoided by doing 1. and 2. in one round. Unfortunately the current controller implementation makes that non-trivial. This commit changes the leader to allow the state where the ISR contains ids that are not in the replica set and to remove such ids from the ISR if required. *More detailed description of your change, if necessary. The PR title and PR message become the squashed commit message, so use a separate comment to ping reviewers.* *Summary of testing strategy (including rationale) for the feature or bug fix. Unit and/or integration tests are expected for any behaviour change and system tests should be considered for larger changes.* ### 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org