Prior to this patch, we only include znode in ZkData.PersistentZkPaths() if 
there is no need for the data in the znode. This patch changes this behavior 
such that we create znode will null data and we assume epoch is -1 if the data 
is null.

The previous approach says that either the znode does not exist, or the znode 
exists with valid data. The new approach says that either the znode exists with 
null, or the znode exists with valid data. I personally prefer the previous 
approach and I would prefer not to define a znode with null data and add 
additional code to handle that case. And in general it is probably better to 
keep the existing code if there is no difference in correctness/performance and 
the difference in code style is not very obvious w.r.t which one is better.

It looks like the main concern with the previous approach is about code 
complexity. How about we have create and call method 
`maybeCreateControllerEpochZnode` at the beginning of `registerController()`?

[ Full content available at: https://github.com/apache/kafka/pull/5101 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to