liveBook · Manning

Metadata log

As explained in Kafka for Architects

A Raft log is an ordered replicated log used by Kafka controllers in KRaft mode to store changes to cluster metadata.

A Kafka cluster needs a reliable record of changes to its state. In KRaft mode, controllers keep that record in a replicated metadata log. It records changes such as topic creation, partition assignments, and broker registrations; brokers handle client traffic rather than storing this controller log. section 1.3.2 section 9.1

The log is stored as Raft log files on controller filesystems. It is sometimes called the `__cluster_metadata` topic, but it is not an ordinary topic stored on brokers: controllers participate in its Raft quorum and write to it. Brokers may keep a local, read-only copy for faster metadata access. section 9.1.1

A topic creation request

An admin client sends a request to a broker, which forwards the metadata operation to the leader controller. The leader appends the update; follower controllers fetch it. The update is committed after a majority replicate it, and brokers fetch metadata updates to stay synchronized. Regular clients obtain metadata through brokers, not directly from the log. section 9.1 section 9.1.1

Figure 9.2 Metadata updates are sent to the leader controller, which appends each update to its log. Follower controllers fetch these updates from the leader, and once a majority have replicated the update, it is marked as committed.
A black background with white text

AI-generated content may be incorrect.

Follow an update from the leader’s log through follower replication to majority commit. section 9.1.1

This quorum requirement protects committed metadata across controller leader changes, but it also shapes availability: without a controller majority, leader elections and metadata changes halt. Controller placement therefore belongs in high-availability planning. Periodic snapshots capture committed state, while an in-memory cache supports rapid access. section 9.1.1 section 9.5

How Kafka for Architects covers it

How deep it goes
Explains controller storage, replication, majority commit, and snapshots at an architectural level rather than detailing log-file formats.
Examples
Traces a topic-creation request from an admin client through a broker to the leader controller and replicated log.
What it assumes
Assumes basic familiarity with Kafka brokers and topics while defining controller roles and distinguishing Raft from KRaft.
What you can do after
Evaluate/understand how controller-majority loss affects metadata changes and high-availability topology.
How it connects
Links Raft consensus, controller quorums, broker metadata access, snapshots, and leader election.

Also explained in

Compare how 2 books explain metadata log →

Related concepts

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