IntermediateInternals
Explain the Kafka controller's responsibilities in KRaft mode.
Reference answer
The KRaft active controller's responsibilities: 1) Processes all metadata changes (broker registration/deregistration, topic create/delete, partition assignment). 2) Manages leader election for all partitions. 3) Writes metadata records to __cluster_metadata topic as the single writer. 4) Handles epoch fencing — ignores commands from stale (lower epoch) controllers. 5) Broadcasts metadata snapshots to brokers. 6) Manages broker feature levels. Standby controllers in the quorum replicate the metadata log and are ready to become active if the current controller fails.
Expected key concepts: metadata changes, leader election, __cluster_metadata, single writer, epoch fencing, snapshots, standby controllers, Raft quorum, broker registration