[
https://issues.apache.org/jira/browse/KAFKA-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15057341#comment-15057341
]
Grant Henke commented on KAFKA-2987:
------------------------------------
Hi [~microwish],
I would suggest posting questions like this to the user mailing list first
before opening a jira. Keep that in mind for next time.
It looks like you are in a hurry, so if deleting manually is your best option
below are some rough steps. Use at your own risk.
{noformat}
1. Make sure no one is producing to or consuming from this topic and no
preferred replica/leader elections have been triggered
2. Delete all topic state from Zookeeper (If a chroot is configured prepend
that to all paths below)
a. Open the Zookeeper client
b. If the topic has been marked for notification remove that notification
node in Zookeeper
ls /admin/delete-topics/${TOPIC}
rmr /admin/delete-topics/${TOPIC}
c. If the topic has configuration remove that node in Zookeeper
ls /config/topics/${TOPIC}
rmr /config/topics/${TOPIC}
d. Remove the topic data in Zookeeper
ls /brokers/topics/${TOPIC}
rmr /brokers/topics/${TOPIC}
3. Delete all topic data on disk
- On all Kafka nodes, for all locations in the Data Directories(log.dirs)
configuration, delete the topics data.
- The paths will be in the format of ${DATADIR}/${TOPIC}-{PARTITIONID}
ls ${DATADIR} | grep "${TOPIC}-*"
rm -r ${DATADIR}/${TOPIC}-*
Warning: Make sure the regex match only matches your topic. Ex: topic-* will
match topic-0 and topic-alt-0
4. Start or restart Kafka to clear out any topic metrics or cached metadata
{noformat}
*Note*: More can be read about Kafka's zookeeper state at these links:
http://kafka.apache.org/documentation.html#impl_zookeeper
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+data+structures+in+Zookeeper
> error of producing messages after topic was marked for deleteion
> ----------------------------------------------------------------
>
> Key: KAFKA-2987
> URL: https://issues.apache.org/jira/browse/KAFKA-2987
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.8.2.1
> Reporter: Glen Cao
> Priority: Critical
>
> I executed "bin/kafka-topics.sh --delete" and made a topic marked for
> deletion.
> However, after server hours, I executed "bin/kafka-topics.sh --list " and the
> status of the topic was still "marked for deleteion". What's worse, when I
> tried creating the topic using "bin/kafka-topics.sh --create",
> kafka.common.TopicExistsException was thrown.
> So, with "auto.create.topics.enable=false", I cannot produce messages.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)