Skip to content
Kafka Is Fun

IntermediateOperations

What is partition reassignment and when do you need it?

Reference answer

Partition reassignment moves partition replicas between brokers, for example after adding brokers, when decommissioning brokers, or to fix uneven data distribution. The kafka-reassign-partitions.sh tool has three modes: --generate, which only produces a candidate reassignment plan (the tool cannot automatically study the data distribution), --execute, which starts the reassignment from a JSON plan, and --verify, which checks its status against the same file. Replication traffic during a reassignment can be limited with --throttle; the docs say to remove the throttle once rebalancing completes, and that a throttle set too low can stop replication from making progress. While a reassignment is in progress the broker metrics ReassignmentBytesInPerSec and ReassignmentBytesOutPerSec are non-zero, and ReassigningPartitions counts the reassigning leader partitions on a broker.

Expected key concepts: partition reassignment, kafka-reassign-partitions.sh, --generate, --execute, --verify, throttle, decommissioning, ReassignmentBytesInPerSec, JSON plan, uneven data distribution

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.