PreferredReplicaLeaderElection Controller Event
PreferredReplicaLeaderElection is a controller event that transition the KafkaController to ManualLeaderBalance state.
PreferredReplicaLeaderElection takes the following to be created:
-
Election type (default: ZkTriggered)
PreferredReplicaLeaderElection is enqueued when KafkaController is requested for the following:
-
removePartitionsFromPreferredReplicaElection and
isTriggeredByAutoRebalanceflag is off
|
Note
|
FIXME When removePartitionsFromPreferredReplicaElection and isTriggeredByAutoRebalance flag is off?
|
When created, PreferredReplicaLeaderElection is given the optional partitions and the electionType as follows:
-
No partitions (
None) and the defaultZkTriggeredwhen:-
KafkaControlleris requested to removePartitionsFromPreferredReplicaElection andisTriggeredByAutoRebalanceflag is off -
PreferredReplicaElectionHandler is notified about a new node under
/admin/preferred_replica_electionpath in Zookeeper (handleCreation).
-
-
Some partitions,
AdminClientTriggeredelection type and a custom callback whenKafkaControlleris requested to electPreferredLeaders
Processing PreferredReplicaLeaderElection
When processed (on the controller-event-thread), KafkaController is requested to processPreferredReplicaLeaderElection.
Preempting PreferredReplicaLeaderElection
When preempted, KafkaController is requested to preemptPreferredReplicaLeaderElection.
Election Type
Election type can be one of the following: