Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka: What do the numbers in controller_epoch and leader_epoch mean?

Tags:

apache-kafka

Kafka updates the state information in zookeeper as below. What do the _epoch numbers really mean? The Kafka documentation does not seems to have a good explanation of the terms.

[zk: localhost:2181(CONNECTED) 69] get /brokers/topics/my-topic/partitions/1/state
{"controller_epoch":29,"leader":2,"version":1,"leader_epoch":28,"isr":[2,1,0]}
like image 1000
justAnotherGuy Avatar asked Oct 14 '25 15:10

justAnotherGuy


1 Answers

It is sort of a decision version number. Brokers skip all but the latest decision on the controller. Epoch can be useful for tracking the generation and validity of a controller decision.

Epoch is very similar to the concept 'term' in Raft protocol.

like image 113
amethystic Avatar answered Oct 21 '25 14:10

amethystic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!