Skip to content
Kafka Is Fun

IntermediateKafka 4.x

What did Kafka 4.0 remove regarding ZooKeeper, and what must a ZooKeeper-mode cluster do before it can upgrade to 4.0?

Reference answer

Kafka 4.0 removed ZooKeeper mode entirely and supports only KRaft. A cluster still on ZooKeeper must first be migrated to KRaft, on a 3.9 release (the last bridge release and the last line that supports ZooKeeper mode), because a ZooKeeper-mode cluster cannot be upgraded to 4.0 directly. The migration passes through phases: a KRaft controller quorum loads the metadata from ZooKeeper, brokers are restarted in migration mode (the hybrid phase, where some brokers are still in ZooKeeper mode), then moved to KRaft one at a time (the dual-write phase, where all brokers are KRaft but the controller still writes to ZooKeeper), and finally the migration is finalized by removing the zookeeper.metadata.migration.enable property from the controllers. A rollback to ZooKeeper mode is possible until the migration is finalized.

Expected key concepts: ZooKeeper, KRaft, 3.9, migration, hybrid, dual-write, finalize, rollback, 4.0, controller quorum

How did that feel?

Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.