0

When attempting to delete a topic using the kafka-topics.sh script, I can see that the topics in the log.dir are marked for deletion, but not all partitions belonging to the topic have been marked.

Eventually, the partitions marked for deletion are in fact deleted, but the others remain and the topic remains in the topic list.

I have set delete.topic.enable to true.

Is there a process to manually delete the topic when running in KRaft mode? I thought I could:

  1. Stop kafka
  2. Manually delete the folders from log.dir
  3. Restart kafka

However, I am wondering if I need to fire up kafka-metadata-shell.sh and run a rmr or rm command in there.

Any help or advice appreciated. Thanks.

  • It's eventually consistent... How long are you waiting? And I assume you are using version 3.3.1+? – OneCricketeer Dec 07 '22 at 22:18
  • Thanks. Yes, version 3.3.1. We deleted topics over a week ago, and they are still there. – Jon Phelps Dec 08 '22 at 21:24
  • Are you collecting broker logs? The LogCleaner class should report what it is deleting, or not, as well as exceptions doing so. If that thread crashes, then restarting the broker will fix that – OneCricketeer Dec 08 '22 at 21:49
  • 1
    Thanks for all the advice. It turned out that I needed to implicity add auto.create.topics.enable=false to the properties config file. I note that this supposed to be false by default, however adding it to the properties config allows me to delete topics without have them reappear. – Jon Phelps Dec 20 '22 at 06:55
  • Hmm. Are you certain that fixed it, or restarting the broker after making the properties changes fixes it? Like I said, restarting the brokers will restart the LogCleaner thread. You could even increase the number of those threads – OneCricketeer Dec 20 '22 at 15:03

0 Answers0