GitHub user guozhangwang opened a pull request: https://github.com/apache/kafka/pull/3130
KAFKA-5202: Handle topic deletion while trying to send txn markers Here is the sketch of this proposal: 1. When handling `addPartition` request, the coordinator will check if all its corresponding metadata exist in the metadata cache; if there is ANY one of the partitions whose metadata is not available, return UNKNOWN_TOPIC_OR_PARTITION. 2. When it is time to send the txn markers, only look for the leader node of the partition once instead of retrying, and if that information is not available, it means the partition is highly likely been removed since it was in the cache before. In this case, we just remove the partition from the metadata object and skip putting into the corresponding queue, and if all partitions' leader broker are non-available, complete this delayed operation to proceed to write the complete txn log entry. One caveat of this approach is the delete-and-recreate case, and the argument is that since all the messages are deleted anyways when deleting the topic-partition, it does not matter whether the markers are on the log partitions or not. You can merge this pull request into a Git repository by running: $ git pull https://github.com/guozhangwang/kafka K5202-handle-topic-deletion Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3130.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3130 ---- commit 733f352bd9be29d1439844271f22508a2e4b2552 Author: Guozhang Wang <wangg...@gmail.com> Date: 2017-05-23T23:23:45Z handle topic deletion ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---