Kafka
  1. Kafka
  2. KAFKA-330 Add delete topic support
  3. KAFKA-784

creating topic without partitions, deleting then creating with partition causes errors in 'kafka-list-topic'

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.2.0
    • Component/s: core
    • Labels:
      None
    • Environment:
      0.8.0 head as of 3/4/2013

      Description

      Create a new topic using the command line:

      ./kafka-create-topic.sh --topic trash-1 --replica 3 --zookeeper localhost

      Realize you forgot to add the partition command, so remove it:

      ./kafka-delete-topic.sh --topic trash-1 --zookeeper localhost

      Recreate it with partitions:

      ./kafka-create-topic.sh --topic trash-1 --replica 3 --zookeeper localhost --partition 5

      Try to get a listing:

      ./kafka-list-topic.sh --topic trash-1 --zookeeper localhost

      Errors:

      [2013-03-04 14:15:23,876] ERROR Error while fetching metadata for partition [trash-1,0] (kafka.admin.AdminUtils$)
      kafka.common.LeaderNotAvailableException: Leader not available for topic trash-1 partition 0
      at kafka.admin.AdminUtils$$anonfun$3.apply(AdminUtils.scala:120)
      at kafka.admin.AdminUtils$$anonfun$3.apply(AdminUtils.scala:103)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
      at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
      at scala.collection.immutable.List.foreach(List.scala:45)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:206)
      at scala.collection.immutable.List.map(List.scala:45)
      at kafka.admin.AdminUtils$.kafka$admin$AdminUtils$$fetchTopicMetadataFromZk(AdminUtils.scala:103)
      at kafka.admin.AdminUtils$.fetchTopicMetadataFromZk(AdminUtils.scala:92)
      at kafka.admin.ListTopicCommand$.showTopic(ListTopicCommand.scala:80)
      at kafka.admin.ListTopicCommand$$anonfun$main$2.apply(ListTopicCommand.scala:66)
      at kafka.admin.ListTopicCommand$$anonfun$main$2.apply(ListTopicCommand.scala:65)
      at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
      at scala.collection.immutable.List.foreach(List.scala:45)
      at kafka.admin.ListTopicCommand$.main(ListTopicCommand.scala:65)
      at kafka.admin.ListTopicCommand.main(ListTopicCommand.scala)
      Caused by: kafka.common.LeaderNotAvailableException: No leader exists for partition 0
      at kafka.admin.AdminUtils$$anonfun$3.apply(AdminUtils.scala:117)
      ... 16 more
      topic: trash-1
      PartitionMetadata(0,None,List(),List(),5)

      Can't recover until you restart all the Brokers in the cluster. Then the list command works correctly.

        Issue Links

          Activity

          Chris Curtin created issue -
          Hide
          Neha Narkhede added a comment -

          The delete topic functionality is not yet implemented in Kafka. Somehow a half baked version made it to the 0.8 branch. We plan to do this before release, we can revisit this at that time.

          Show
          Neha Narkhede added a comment - The delete topic functionality is not yet implemented in Kafka. Somehow a half baked version made it to the 0.8 branch. We plan to do this before release, we can revisit this at that time.
          Neha Narkhede made changes -
          Field Original Value New Value
          Link This issue is related to KAFKA-330 [ KAFKA-330 ]
          Swapnil Ghike made changes -
          Parent KAFKA-330 [ 12550245 ]
          Issue Type Bug [ 1 ] Sub-task [ 7 ]
          Swapnil Ghike made changes -
          Assignee Swapnil Ghike [ swapnilghike ]
          Hide
          Ahmet AKYOL added a comment -

          happy to hear that. I was using this version:

          ./kafka-run-class.sh kafka.admin.DeleteTopicCommand --topic mytopic --zookeeper localhost:2181

          I couldn't create same topic after that until removing related kafka data logs manually.

          Show
          Ahmet AKYOL added a comment - happy to hear that. I was using this version: ./kafka-run-class.sh kafka.admin.DeleteTopicCommand --topic mytopic --zookeeper localhost:2181 I couldn't create same topic after that until removing related kafka data logs manually.
          Sriharsha Chintalapani made changes -
          Fix Version/s 0.8.2 [ 12326167 ]
          Sriharsha Chintalapani made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Sriharsha Chintalapani added a comment -

          Ahmet AKYOL with kafka 0.8.2 branch or trunk . kafka-topics won't allow creation of topic without --partitions and --replication-factor. Once the topic is created , deleting the topic and re-creating works fine. Also tested this by increasing the topic partitions and deleting it works fine. Closing this as resolved.

          Show
          Sriharsha Chintalapani added a comment - Ahmet AKYOL with kafka 0.8.2 branch or trunk . kafka-topics won't allow creation of topic without --partitions and --replication-factor. Once the topic is created , deleting the topic and re-creating works fine. Also tested this by increasing the topic partitions and deleting it works fine. Closing this as resolved.
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          584d 20h 13m 1 Sriharsha Chintalapani 10/Oct/14 16:34

            People

            • Assignee:
              Swapnil Ghike
              Reporter:
              Chris Curtin
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development