jolshan commented on a change in pull request #10952: URL: https://github.com/apache/kafka/pull/10952#discussion_r669069127
########## File path: clients/src/main/java/org/apache/kafka/clients/Metadata.java ########## @@ -391,10 +393,15 @@ else if (metadata.error() == Errors.TOPIC_AUTHORIZATION_FAILED) int newEpoch = partitionMetadata.leaderEpoch.get(); // If the received leader epoch is at least the same as the previous one, update the metadata Integer currentEpoch = lastSeenLeaderEpochs.get(tp); - if (currentEpoch == null || newEpoch >= currentEpoch || changedTopicId) { + if (currentEpoch == null || newEpoch >= currentEpoch) { log.debug("Updating last seen epoch for partition {} from {} to epoch {} from new metadata", tp, currentEpoch, newEpoch); lastSeenLeaderEpochs.put(tp, newEpoch); return Optional.of(partitionMetadata); + } else if (changedTopicId) { + log.debug("Topic ID changed, so this topic must have been recreated. " + Review comment: Hmm I don't actually have access to both the topic IDs in this method. I can just do the old one and/or pass in the parameter for the new one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org