[ https://issues.apache.org/jira/browse/KAFKA-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233885#comment-13233885 ]
Jun Rao commented on KAFKA-300: ------------------------------- Thanks for the patch. Some comments: 1. KafkaZookeeper: 1.1 LeaderChangeListener.handleDataDeleted: no need to first check that leader exists. Since leader could change immediately after the check is done and subsequent logic still needs to handle this case. 1.2 TopicChangeListener: curChilds returned from the call back gives all children, not just new children. 1.3 SessionExpireListener: We could missed some new topics created when a session expires. Just calling subscribeToTopicAndPartitionsChanges may not be enough since we may need to call handleNewTopics for those missed new topics. 1.4 leaderElection probably needs to return a boolean to indicate if the election succeeded or not. 2. LogManager: 2.1 It seems to me that replicas is not directly tied to LogManager and probably should be kept somewhere else, like KafkaServer. 2.2 It aslo seems that we need to keep a map of (topic, partition_id, broker_id) => Replica so that we can address each replica more efficiently. This can be either a 1 level or a 2 level map. 3. DefaultEventHandler.handle: We probably should break out of the loop when outstandingProduceRequests is empty. 4. ZkUtils.waitUntilLeaderIsElected should be moved to test (sth like ZKTestUtil). 5. KafkaServer,BrokerPartitionInfo,DefaulEventHandler,LazyProducerTest,LeaderElectionTest: removed unused imports > Implement leader election > ------------------------- > > Key: KAFKA-300 > URL: https://issues.apache.org/jira/browse/KAFKA-300 > Project: Kafka > Issue Type: Sub-task > Reporter: Neha Narkhede > Attachments: kafka-300.patch > > > According to the Kafka replication design > (https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Replication), this > JIRA will involve implementing the leaderElection() procedure. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira