You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2014/10/09 23:51:19 UTC
git commit: kafka-1558; AdminUtils.deleteTopic does not work;
patched by Sriharsha Chintalapani; reviewed by Jun Rao
Repository: kafka
Updated Branches:
refs/heads/trunk a7e49298b -> a314461fa
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/a314461f
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/a314461f
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/a314461f
Branch: refs/heads/trunk
Commit: a314461fa04b3249608607d1040c8e0cf8724bac
Parents: a7e4929
Author: Sriharsha Chintalapani <sc...@hortonworks.com>
Authored: Thu Oct 9 14:51:08 2014 -0700
Committer: Jun Rao <ju...@gmail.com>
Committed: Thu Oct 9 14:51:08 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/a314461f/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/a314461f/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)
}
}
}