milindl commented on code in PR #14111:
URL: https://github.com/apache/kafka/pull/14111#discussion_r1305499631


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -408,11 +463,13 @@ private Optional<MetadataResponse.PartitionMetadata> 
updateLatestMetadata(
                 log.info("Resetting the last seen epoch of partition {} to {} 
since the associated topicId changed from {} to {}",
                         tp, newEpoch, oldTopicId, topicId);
                 lastSeenLeaderEpochs.put(tp, newEpoch);
+                this.equivalentResponseCount = 0;
                 return Optional.of(partitionMetadata);
             } else if (newEpoch >= currentEpoch) {
                 // If the received leader epoch is at least the same as the 
previous one, update the metadata
                 log.debug("Updating last seen epoch for partition {} from {} 
to epoch {} from new metadata", tp, currentEpoch, newEpoch);
                 lastSeenLeaderEpochs.put(tp, newEpoch);
+                this.equivalentResponseCount = 0;

Review Comment:
   More of a question than a comment, but why do we reset 
`equivalentResponseCount` even if `newEpoch == currentEpoch` ? If epoch is 
available, then shouldn't we reset it only when `newEpoch > currentEpoch`?



-- 
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

Reply via email to