kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-1558; AdminUtils.deleteTopic does not work; patched by Sriharsha Chintalapani; reviewed by Jun Rao
Date Thu, 09 Oct 2014 21:52:51 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.8.2 3d6df5494 -> 841d44139


kafka-1558; AdminUtils.deleteTopic does not work; patched by Sriharsha Chintalapani; reviewed
by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/841d4413
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/841d4413
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/841d4413

Branch: refs/heads/0.8.2
Commit: 841d44139dc1c2f46f9ed0d783776776a6da3e7e
Parents: 3d6df54
Author: Sriharsha Chintalapani <schintalapani@hortonworks.com>
Authored: Thu Oct 9 14:52:38 2014 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Thu Oct 9 14:52:38 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/controller/KafkaController.scala       | 3 +--
 core/src/main/scala/kafka/controller/PartitionStateMachine.scala | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/841d4413/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 8ab4a1b..381c52f 100644
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -1300,8 +1300,7 @@ class PreferredReplicaElectionListener(controller: KafkaController)
extends IZkD
         error("Skipping preferred replica election for partitions %s since the respective
topics are being deleted"
           .format(partitionsForTopicsToBeDeleted))
       }
-      else
-        controller.onPreferredReplicaElection(partitions -- partitionsForTopicsToBeDeleted)
+      controller.onPreferredReplicaElection(partitions -- partitionsForTopicsToBeDeleted)
     }
   }
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/841d4413/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/PartitionStateMachine.scala b/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
index e20b63a..2f0694b 100644
--- a/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
+++ b/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
@@ -484,8 +484,6 @@ class PartitionStateMachine(controller: KafkaController) extends Logging
{
         topicsToBeDeleted --= nonExistentTopics
         if(topicsToBeDeleted.size > 0) {
           info("Starting topic deletion for topics " + topicsToBeDeleted.mkString(","))
-          // add topic to deletion list
-          controller.deleteTopicManager.enqueueTopicsForDeletion(topicsToBeDeleted)
           // mark topic ineligible for deletion if other state changes are in progress
           topicsToBeDeleted.foreach { topic =>
             val preferredReplicaElectionInProgress =
@@ -495,6 +493,8 @@ class PartitionStateMachine(controller: KafkaController) extends Logging
{
             if(preferredReplicaElectionInProgress || partitionReassignmentInProgress)
               controller.deleteTopicManager.markTopicIneligibleForDeletion(Set(topic))
           }
+          // add topic to deletion list
+          controller.deleteTopicManager.enqueueTopicsForDeletion(topicsToBeDeleted)
         }
       }
     }


Mime
View raw message