I have issued the command to delete a topic:
./bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic vip_ips_alerts
It seemed to give a happy response:
[2014-05-31 20:58:10,112] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
Topic "vip_ips_alerts" queued for deletion.
But now 10 minutes later the topic still appears in the --list
command:
./bin/kafka-topics.sh --zookeeper localhost:2181 --list
vip_ips_alerts - marked for deletion
So what does that mean? When will the topic be really deleted? How do I expedite this process?
The deletion happened for me almost immediately (v 0.9). I believe that it should be the same for you.
Once marked, the deletion will be triggered on the kafka node which is the topic partition leader. The thing to remember is that the the topic partition leader must be configured correctly (in terms of listeners), otherwise it will not receive the instruction to delete the logs.
I had my "marked for deletion" topics stuck at that state until I corrected my server properties and restarted the respective node.
tl;dr Set
delete.topic.enable = true
inconfig/server.properties
of Kafka brokers and...be patient.It happens with the latest development version of Kafka 0.8.3-SNAPSHOT:
The point is to have
delete.topic.enable=true
inconfig/server.properties
that you use to start a Kafka broker.You can also ensure the setting be true in a broker's log:
In my case where i am using Kafka 8.2.2, I had to delete entries from the following manually -
Login to zookeeper and -
For kafka version 0.10.0.0 it is enough to enable the topic deletion by setting:
delete.topic.enable
The topic is deleted within few moments. No restart needed.
kafka-topics --delete --zookeeper your-zk:2181 --topic yourTopicName
You can confirm that it is gone with the command:
kafka-topics --describe --zookeeper your-zk:2181 --topic yourTopicName
We had this issue when deleting topics. The topics had been created when delete.topic.enable=true had not been set. We set that in config, restarted kafka to apply the new config. Deleted the topics and saw the "marked for deletion". We then restarted kafka again. After 40 minutes though all topics had been deleted (9 topics with total partitions in the thousands). The topics with higher numbers of partitions seemed to take longer, which initially made it look like nothing was happening.
For kafka version
0.10.0.0
it is enough to enable the topic deletion by setting:The topic is deleted within few moments
You can confirm that it is gone with the following command: