[ 
https://issues.apache.org/jira/browse/KAFKA-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635596#comment-14635596
 ] 

Edward Ribeiro commented on KAFKA-2345:
---------------------------------------

[~singhashish], [~gwenshap], sorry, late to the party (already committed to 
trunk), but I think this patch could benefit from a unit test in 
{{DeleteTopicTest}}, right? I scribbled one below. Cheers!

{code}
  @Test
  def testDeleteTopicMarkedAsDeleted() {
    val topicAndPartition = TopicAndPartition("test", 0)
    val topic = topicAndPartition.topic
    val servers = createTestTopicAndCluster(topic)
    // start topic deletion
    AdminUtils.deleteTopic(zkClient, topic)
    try {
      // try to delete topic marked as deleted
      AdminUtils.deleteTopic(zkClient, topic)
      fail("Expected TopicAlreadyMarkedForDeletionException")
    }
    catch {
      case e: TopicAlreadyMarkedForDeletionException => // expected exception
    }

    TestUtils.verifyTopicDeletion(zkClient, topic, 1, servers)
    servers.foreach(_.shutdown())
  }
{code}

> Attempt to delete a topic already marked for deletion throws 
> ZkNodeExistsException
> ----------------------------------------------------------------------------------
>
>                 Key: KAFKA-2345
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2345
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ashish K Singh
>            Assignee: Ashish K Singh
>             Fix For: 0.8.3
>
>         Attachments: KAFKA-2345.patch, KAFKA-2345_2015-07-17_10:20:55.patch
>
>
> Throwing a TopicAlreadyMarkedForDeletionException will make much more sense. 
> A user does not necessarily have to know about involvement of zk in the 
> process.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to