Return-Path: X-Original-To: apmail-kafka-commits-archive@www.apache.org Delivered-To: apmail-kafka-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 849DB1790A for ; Wed, 12 Nov 2014 02:42:39 +0000 (UTC) Received: (qmail 30076 invoked by uid 500); 12 Nov 2014 02:42:39 -0000 Delivered-To: apmail-kafka-commits-archive@kafka.apache.org Received: (qmail 30055 invoked by uid 500); 12 Nov 2014 02:42:39 -0000 Mailing-List: contact commits-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list commits@kafka.apache.org Received: (qmail 30046 invoked by uid 99); 12 Nov 2014 02:42:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 02:42:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 23F9EA0F056; Wed, 12 Nov 2014 02:42:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jjkoshy@apache.org To: commits@kafka.apache.org Message-Id: <1dfdcc8bf2b746faab3d37eb3bdf8b9a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: kafka git commit: KAFKA-1742; ControllerContext removeTopic does not correctly update state; reviewed by Joel Koshy, Guozhang Wang and Neha Narkhede Date: Wed, 12 Nov 2014 02:42:39 +0000 (UTC) Repository: kafka Updated Branches: refs/heads/trunk 9b3da9fbf -> 53160bb07 KAFKA-1742; ControllerContext removeTopic does not correctly update state; reviewed by Joel Koshy, Guozhang Wang and Neha Narkhede Project: http://git-wip-us.apache.org/repos/asf/kafka/repo Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/53160bb0 Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/53160bb0 Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/53160bb0 Branch: refs/heads/trunk Commit: 53160bb07c9f77ed21f486ed448aff0277c139b0 Parents: 9b3da9f Author: Onur Karaman Authored: Tue Nov 11 18:42:22 2014 -0800 Committer: Joel Koshy Committed: Tue Nov 11 18:42:22 2014 -0800 ---------------------------------------------------------------------- core/src/main/scala/kafka/controller/KafkaController.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kafka/blob/53160bb0/core/src/main/scala/kafka/controller/KafkaController.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/kafka/controller/KafkaController.scala b/core/src/main/scala/kafka/controller/KafkaController.scala index 51a5bad..66df6d2 100644 --- a/core/src/main/scala/kafka/controller/KafkaController.scala +++ b/core/src/main/scala/kafka/controller/KafkaController.scala @@ -115,8 +115,8 @@ class ControllerContext(val zkClient: ZkClient, } def removeTopic(topic: String) = { - partitionLeadershipInfo = partitionLeadershipInfo.dropWhile(p => p._1.topic.equals(topic)) - partitionReplicaAssignment = partitionReplicaAssignment.dropWhile(p => p._1.topic.equals(topic)) + partitionLeadershipInfo = partitionLeadershipInfo.filter{ case (topicAndPartition, _) => topicAndPartition.topic != topic } + partitionReplicaAssignment = partitionReplicaAssignment.filter{ case (topicAndPartition, _) => topicAndPartition.topic != topic } allTopics -= topic } }