Add partitions to existing topic with optional replica assignment
Add partitions to existing topic with optional replica assignment
Zookeeper client
Topic for adding partitions to
Number of partitions to be set
Manual replica assignment
Ignore checking if assigned replica broker is available. Only used for testing
Pre-existing properties that should be preserved
There are 2 goals of replica assignment: 1.
There are 2 goals of replica assignment: 1. Spread the replicas evenly among brokers. 2. For partitions assigned to a particular broker, their other replicas are spread over the other brokers.
To achieve this goal, we: 1. Assign the first replica of each partition by round-robin, starting from a random position in the broker list. 2. Assign the remaining replicas of each partition with an increasing shift.
Here is an example of assigning broker-0 broker-1 broker-2 broker-3 broker-4 p0 p1 p2 p3 p4 (1st replica) p5 p6 p7 p8 p9 (1st replica) p4 p0 p1 p2 p3 (2nd replica) p8 p9 p5 p6 p7 (2nd replica) p3 p4 p0 p1 p2 (3nd replica) p7 p8 p9 p5 p6 (3nd replica)
Update the config for an existing topic and create a change notification so the change will propagate to other brokers
Read the topic config (if any) from zk