Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8954C96A3 for ; Tue, 6 Nov 2012 17:40:16 +0000 (UTC) Received: (qmail 84551 invoked by uid 500); 6 Nov 2012 17:40:16 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 84513 invoked by uid 500); 6 Nov 2012 17:40:16 -0000 Mailing-List: contact kafka-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-dev@incubator.apache.org Received: (qmail 84499 invoked by uid 99); 6 Nov 2012 17:40:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 17:40:16 +0000 Date: Tue, 6 Nov 2012 17:40:16 +0000 (UTC) From: "Jun Rao (JIRA)" To: kafka-dev@incubator.apache.org Message-ID: <1632468776.75318.1352223616175.JavaMail.jiratomcat@arcas> In-Reply-To: <2077288163.51967.1350403863901.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (KAFKA-574) KafkaController unnecessarily reads leaderAndIsr info from ZK MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491642#comment-13491642 ] Jun Rao commented on KAFKA-574: ------------------------------- Thanks for patch v3. Just one more comment: 30. KafkaController.removeReplicaFromIsr(): Shouldn't we only update newLeaderAndIsr in the cache if updateSucceeded is true? 20. Ignore my comment on leaderAndIsrIsEmpty. It is fine. I ran system tests with your patch and they seem to pass. Did you build the Kafka jar before running the test? > KafkaController unnecessarily reads leaderAndIsr info from ZK > ------------------------------------------------------------- > > Key: KAFKA-574 > URL: https://issues.apache.org/jira/browse/KAFKA-574 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.8 > Reporter: Jun Rao > Assignee: Prashanth Menon > Priority: Blocker > Labels: bugs > Attachments: KAFKA-574-v1.patch, KAFKA-574-v2.patch, KAFKA-574-v3.patch > > Original Estimate: 48h > Remaining Estimate: 48h > > KafkaController calls updateLeaderAndIsrCache() in onBrokerFailure(). This is unnecessary since in onBrokerFailure(), we will make leader and isr change anyway so there is no need to first read that information from ZK. Latency is critical in onBrokerFailure() since it determines how quickly a leader can be made online. > Similarly, updateLeaderAndIsrCache() is called in onBrokerStartup() unnecessarily. In this case, the controller does not change the leader or the isr. It just needs to send the current leader and the isr info to the newly started broker. We already cache leader in the controller. Isr in theory could change any time by the leader. So, reading from ZK doesn't guarantee that we can get the latest isr anyway. Instead, we just need to get the isr last selected by the controller (which can be cached together with the leader in the controller). If the leader epoc in a broker is at or larger than the epoc in the leaderAndIsr request, the broker can just ignore it. Otherwise, the leader and the isr selected by the controller should be used. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira