Search code examples
apache-kafkaconfluent-platformkafka-topic

marked for deletion message in broker kafka


why when deleting one topic in Kafka by this command :

/opt/kafka/confluent-4.0.0/bin/kafka-topics --zookeeper 109.169.xxx.xx:2181  --delete --topic test

and again see the list of Topics again, This message appears?

test - marked for deletion

Solution

  • If after a long time your topic is not deleted then make sure that delete.topic.enable in server.properties is set to true (although confluent 4.0.0 comes with this configuration). If you still face the same issue you can manually delete the topic by logging into Zookeeper using

    zookeeper-shell localhost:2181
    

    Now you can remove the topic using

    rmr /brokers/topics/{topic_name}
    rmr /admin/delete_topics/{topic_name}
    

    Note that you might need to delete topic folder from Kafka broker machine before logging into ZK in order to manually remove the topic.