0

Seems difficult to achieve. When I delete a topic and then recreate it with the same name, I notice the previous partitions are already present, which suggests the deletion has not been thorough. I would like to make the topic disappear completely.

1 Answers1

0

kafka-topics --delete operation is asynchronous.

The only way to guarantee a topic is completely deleted would be to manually run rm -rf on each broker in the cluster where a replica exists, then also use zookeeper-shell to remove the topic ZNode entry

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • I'm trying to use zookeeper-shell but I get "JLine support is disabled" :( – Utilitaire CCV Jul 22 '22 at 17:15
  • 1
    Hmm. Never seen that before. Still, it's not really recommended to delete and topic then recreate. Instead, you can [purge it](https://stackoverflow.com/a/69984801/2308683) through retention settings. Or, just create a brand new topic with `-v2` suffix, for example – OneCricketeer Jul 22 '22 at 17:30