Thanks for pointing this out. This is indeed a very dangerous race condition. 
If it happens, the current controller (Broker B) cannot update any zookeeper 
state due to controller epoch zkVersion mismatch and no other broker can become 
the controller because the current controller (Broker B) does not release the 
"lock" for `\controller` znode.

Wrapping `\controller` creation and `\controller_epoch` update in a zookeeper 
transaction can prevent this race condition and I think it is a safe option. I 
will make the change and see whether there will be performance overhead in the 
perf testing.

[ 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