You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jj...@apache.org on 2014/11/12 03:42:39 UTC

kafka git commit: KAFKA-1742; ControllerContext removeTopic does not correctly update state; reviewed by Joel Koshy, Guozhang Wang and Neha Narkhede

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 <ok...@linkedin.com>
Authored: Tue Nov 11 18:42:22 2014 -0800
Committer: Joel Koshy <jj...@gmail.com>
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
   }
 }