Correct me if I am wrong, I think there are two cases when we see 
BadVersionException here:
1. Another round of controller election kicks in and the controller does 
switch. It is safe to throw `ControllerMovedException` in this case.
2. The current broker loss zk connection after zk successfully finishes the 
transaction, **and the controller znode is gone**. In this case, another round 
of controller election will be triggered by zk watcher `handleDeleted`. So I 
think it is also safe to throw `ControllerMovedException` here.

[ 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