Fencing for partition leaders in Kafka to avoid split brain

Is there fencing for partition leaders? What I’m trying to say is, when a broker is elected to lead a partition, I imagine it doesn’t have to consult zookeeper/KRaft in order to accept a request from a producer client.

But how do we avoid split brain in which another leader is elected but the old one isn’t aware?

This is different from fencing in transactions (in which a transaction coordinator fences old clients).

It does have to consult zookeeper. the leader sets an ephemeral node in zk.

For every produce request?

I wasn’t aware ZK could handle such throughput.

Not for every one. that’s another reason we set ACKS=ALL

The followers would get meta data from the controller that the old leader is no longer leader

Is there a small race condition between when the new leader is activated and when the followers are alerted of the new leader?

COuld be. that’s another reason ACKS >1