...
Code Block |
---|
onPartitionsReassigned() { if(this broker is the leader for [partition_id]) { p.RAR = the new replicas from /brokers/partitions_reassigned/[topic]/[partition_id] AR = /brokers/topics/[topic]/[partition_id]/replicas newReplicas = p.RAR - AR for(newReplica <- newReplicas) sendStateChange(“start-replica”, newReplica.broker_id, epoch) if(p.RAR is empty) { for(assignedReplica <- AR) sendStateChange("close-replica", assignedReplica.broker_id, epoch) } } } |
State change communication
...