You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Abhishek Nigam (JIRA)" <ji...@apache.org> on 2015/03/20 00:46:38 UTC

[jira] [Commented] (KAFKA-1778) Create new re-elect controller admin function

    [ https://issues.apache.org/jira/browse/KAFKA-1778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14370385#comment-14370385 ] 

Abhishek Nigam commented on KAFKA-1778:
---------------------------------------

I have a design for pinning the controller to a broker:
e we want to pin the controller to broker id x.

Handling the admin request in the controller:
a) We send the admin request to the controller.
b) It will create a persistent zookeeper node /admin/next_controller with data x.
c) It will then pull the information about broker id x to see if it is up and running through the alive broker list.
d) If the broker is up and running it will start 3-way handshake with x.
e) It will start a watch on /admin/ready_to_serve_as_controller zookeeper node.
f) It will send a message to the broker to tell it that it should become ready to serve as next_controller.
g) Broker x on receiving this message will create ephemeral node /admin/ready_to_server_as_controller.
h) Controller observes this change.
h) At this point the current controller will resign.

Changes in the election code:
a) All the brokers will pull from /admin/ready_to_server_as_controller with a watch.
b) If the brokers find that if this znode exists and their broker.id does not match the id specified in this ephemeral node they will simply not participate in the leader election.
c) Broker x will rightfully takes its place as the next controller.

c) The watches will be used in case broker x comes back to life.
d) In that case if I am the controller then I will resign.

Changes in the controller startup code:
a) Always pull from the /admin/next_controller for data changes as well as new data.
b) If there is any change try to setup the next broker similar to what has been specified in "handling the admin request in the controller".

> Create new re-elect controller admin function
> ---------------------------------------------
>
>                 Key: KAFKA-1778
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1778
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Joe Stein
>            Assignee: Abhishek Nigam
>             Fix For: 0.8.3
>
>
> kafka --controller --elect



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)