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
isTriggeredByAutoRebalance
flag 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 defaultZkTriggered
when:-
KafkaController
is requested to removePartitionsFromPreferredReplicaElection andisTriggeredByAutoRebalance
flag is off -
PreferredReplicaElectionHandler is notified about a new node under
/admin/preferred_replica_election
path in Zookeeper (handleCreation
).
-
-
Some partitions,
AdminClientTriggered
election type and a custom callback whenKafkaController
is 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: