When SRE deletes controller znode, multiple brokers may be doing `elect()`
concurrently and all but one broker will find that the controller znode alread
exists.
Prior to this patch, these brokers will log `debug(s"Broker $activeControllerId
was elected as controller instead of broker ${config.brokerId}")` if controller
znode exists and the controller id is not this broker.
After this patch, these brokers will log `error(s"Error while creating
ephemeral at ${ControllerZNode.path}, node already exists and owner
${getDataResponse.stat.getEphemeralOwner} does not match current session
${zooKeeperClient.sessionId}")` and `error(s"Error while electing or becoming
controller on broker ${config.brokerId} because controller moved to another
broker", e)`
if controller znode exists and the controller id is not this broker.
Since we expect most brokers to find znode to be created by another broker
during `elect()`, we probably want to keep the old behavior instead of having
error level logs.
[ Full content available at: https://github.com/apache/kafka/pull/5101 ]
This message was relayed via gitbox.apache.org for [email protected]