[ https://issues.apache.org/jira/browse/KAFKA-7362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16807191#comment-16807191 ]
xiongqi wu commented on KAFKA-7362: ----------------------------------- [~dhruvilshah] Yes, I agree these two (delete topic and cleanup orphan partition) are two different problems and need to be addressed separately. But When we design the mechanism to cleanup orphan partitions, we want to keep the use case of topic deletion in mind. Regarding the KIP, I am totally fine with fixing it without KIP as long as committers are ok with it. I had the draft implementation before: [https://github.com/xiowu0/kafka/commit/f1bd3085639f41a7af02567550a8e3018cfac3e9] This implement solution doesn't cleanup the orphan partitions immediately but still wait for the default retention time to pass before remove the orphan partitions. It's also one time action after broker boot-up. Alternatively, we could trigger the orphan partition removal after every zookeeper time-time/new session. > enable kafka broker to remove orphan partitions automatically > -------------------------------------------------------------- > > Key: KAFKA-7362 > URL: https://issues.apache.org/jira/browse/KAFKA-7362 > Project: Kafka > Issue Type: Improvement > Components: core, log > Reporter: xiongqi wu > Assignee: xiongqi wu > Priority: Major > > When partition reassignment removes topic partitions from a offline broker, > those removed partitions become orphan partitions to the broker. When the > offline broker comes back online, it is not able to clean up both data and > folders that belong to orphan partitions. Log manager will scan all all dirs > during startup, but the time based retention policy on a topic partition will > not be kicked out until the broker is either a follower or a leader of the > partition. In addition, we do not have logic to delete folders that belong > to orphan partition today. > Open this ticket to provide a mechanism (when enabled) to safely remove > orphan partitions automatically. -- This message was sent by Atlassian JIRA (v7.6.3#76005)