Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-455: an admin API for moving partitions

Cluster and operations · Shipped · since Kafka 2.4 · status checked November 2026

KIP-455 gave Kafka a proper API for moving partition replicas between brokers. Instead of writing a JSON plan into ZooKeeper, a tool asks the controller through the Admin API to reassign, list or cancel moves, and new moves can be added while others are still running. kafka-reassign-partitions.sh uses it.

Proposal
KIP-455, Create an Administrative API for Replica Reassignment
Status
Shipped API in Kafka 2.4 (2019); tool changes, including --cancel, in 2.5.
Area
Cluster and operations
Reassign - leader dropped, new replica outside the ISR. Hand-reassign to broker-2/4/3. The simulator drops leader broker-1 at once, so leadership shifts to in-sync broker-2 (leader epoch bumps) and broker-4 joins at offset 0 OUTSIDE the ISR. Real Kafka keeps broker-1 leading during the copy (replicas 2/4/3/1), so the partition is never under-replicated, and moves leadership only after broker-4 joins the ISR. Open this step in the full playground

Why it was needed

Reassignment used to work by writing a znode in ZooKeeper that the controller watched. Only one batch of moves could run at a time, a running move could not be cancelled cleanly, and any tool doing it needed direct access to ZooKeeper, which got in the way of removing ZooKeeper altogether.

What it changes

The Admin API gained alterPartitionReassignments, to set a target replica list for a partition or cancel its move, and listPartitionReassignments, which shows the replicas being added and removed. The controller adds the new replicas, waits for them to join the ISR and then drops the old ones. Cancelling returns the partition to its original replicas.

How to use it

  • Run kafka-reassign-partitions.sh --bootstrap-server with --generate, --execute and --verify; add --throttle to limit the bandwidth (KIP-73).
  • Use --cancel to stop a running reassignment, and --additional to start more moves or change the throttle while one is running.

Where it stands

The API shipped in Kafka 2.4 and the tool changes in 2.5, which also deprecated the --zookeeper option. Since Kafka 4.0 the cluster runs only on KRaft and this API is the only way to reassign.

What comes next

Stable. Kafka 4.3 added cordoning of brokers and log directories (KIP-1066), which keeps new replicas off a broker you are about to drain.

See it in the simulator

Sources

All Kafka KIPs