We have a topic where even after issuing the kafka-topics 'delete' command, it does not go away. It simply says "TOPIC.A.B.C - marked for deletion". This property 'delete.topic.enable=true' is set to true on all brokers. Is this a known issue and is there a workaround for this? Like manually deleting the topic folder and removing the topic entries in the zookeeper config?
0
votes
1 Answers
0
votes
Forcing a topic delete
A Kafka topic marked for deletion can be deleted by directly logging into the ZooKeeper shell and removing the topic metadata from the cluster. We also recommend removing the log segments from each broker that are associated with the topic.
- zookeeper-shell
- rmr /config/topics/
- rmr /brokers/topics/
- rmr /admin/delete_topics/
- For each broker:
- Shut down the broker
- rm -R ${log.dirs}/-*
- Start up the broker
Note: Step 5 should be done with care to ensure you are only removing the log directories for the topic you are intending to delete