@junrao From the correctness and performance point of view, checking `/controller` payload and checking `/controller` ephemeral owner is the same. The question is whether we need to read `/controller_epoch`. The reason why I do it is because if `NodeExistsException| BadVersionException` happens, we no longer have the `Stat` (new zkVersion) of `/controller_epoch` even though the `/controller_epoch` update succeeds in zookeeper server. We can avoid the extra read on `/controller_epoch` if we can assume that zkVersion is always incremented by one. Since `/controller_epoch` zkVersion is critical for us after this patch and zookeeper doc does not explicitly say that this assumption holds, I think it is safer to do one extra read during controller election.
[ Full content available at: https://github.com/apache/kafka/pull/5101 ] This message was relayed via gitbox.apache.org for [email protected]
