liveBook · Manning

Leader epoch checkpoint file

As explained in Apache Kafka in Action

A leader epoch checkpoint file is a Kafka partition-directory file that records leader-epoch information and the log offset associated with leader selections.

A leader epoch checkpoint file resides in an assigned partition directory and records the metadata version, entry count, and leader-epoch information. Each record pairs the number of previous partition leaders with the log offset when the current leader was selected. section 8.3.2

Observing a leader change

After broker 3 is stopped, the checkpoint shown for broker 1's partition directory changes from 0 0 to 1 0. The epoch increments with each leader change, helping prevent two brokers from claiming leadership for the same partition. section 8.3.2

How Apache Kafka in Action covers it

How deep it goes
Explains the file layout and leader-change mechanism, but stops short of detailing checkpoint maintenance internals.
Examples
Uses partition-directory listings and broker-stop output to compare checkpoint records before and after a leadership change.
What it assumes
Assumes familiarity with Kafka brokers, partitions, replicas, leaders, and log offsets.
What you can do after
Diagnose leader-epoch state by locating a partition directory and reading its checkpoint with cat.
How it connects
Connects partition directories with brokers, replication, leader election, and log offsets.

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.