Hi 晓兵, Are you saying we should not call `removeTopic` because the topic znode is deleted? Have a quick look at the `controllerContext#removeTopic` implementation, it looks like we only clean up the metrics, and local maps. Why is it a problem we called it here? Does it caused any error? Could you elaborate it more?
Thank you. Luke On Mon, Oct 11, 2021 at 6:10 PM 方晓兵 <94fxiaob...@gmail.com> wrote: > Hi Team, > > I have a problem when I study kafka code in version 2.8.0. > > I see `controllerContext.removeTopic(topic)` have been called in > `TopicDeletionManager.completeDeleteTopic()`. TopicChangeHandler not only > listen to child delete but also listen to child add. So every time a topic > is deleted, an invalid event will be triggered because > `controllerContext.removeTopic(topic)` have been called in > `TopicDeletionManager.completeDeleteTopic()` after delete this topic > zookeeper path. Is it code that needs to be optimized? > > Grateful and look forward to answers