Hi, When a topic is marked for deletion it gets put into a queue. and then processed by the controller's delete topic thread. It may take a while for the topic to actually get deleted (if a broker hosting one of it's replicas is down), but during that time the producer can continue writing messages to the topic. Moreover, if one deletes a topic manually (and forgets to clear /admin/delete_topic in Zookeeper), it's possible to get into a state where the topic doesn't exist, but is still marked for deletion. A producer writing to the same topic will auto-create the topic, but the Controller will not create any partitions for it because it's marked for deletion (PartitionStateMachine.scala:513). This will result in a topic with no partitions, and a lot of weird errors (LeaderNotAvilableException for example).
Generally, when would it make sense to continue writing to a topic that is marked for deletion? I propose adding 2 options to: 1) Notify the producer when a topic it's writing to is marked for deletion. 2) Prevent a topic from being re-created for some time after getting deleted. I suppose both would require adding new error codes, which is a fairly big change. Thoughts? Cheers, Eugene