The following is a proposal when the ZooKeeper session has changed and the Broker tries to register himself into ZooKeeper.
Currently, this throws a `NodeExistsException` since a Broker with the same id got registered previously into Zookeeper. **Assuming Broker id = 1** - If a Broker using this patch retries to register himself into ZooKeeper and the previous ZooKeeper session was not the one that registers the Broker (another Broker with the same id did), the Broker won't be allowed to register and a `NodeExistsException` will be generated. - If a Broker using this patch retries to register himself into ZooKeeper and the previous ZooKeeper session was the one that registers the Broker, the ephemeral node will be deleted from ZooKeeper and re-created by the Broker. - If a Broker **not** using this patch retries to register himself into ZooKeeper and the previous ZooKeeper session was not the one that registers the Broker (another Broker with the same id did), the Broker won't be allowed to register and a `NodeExistsException` will be generated. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) [ Full content available at: https://github.com/apache/kafka/pull/5575 ] This message was relayed via gitbox.apache.org for [email protected]
