You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/05/19 19:06:59 UTC

[GitHub] [kafka] hachikuji commented on a change in pull request #8376: KAFKA-9724 Newer clients not always sending fetch request to older brokers

hachikuji commented on a change in pull request #8376:
URL: https://github.com/apache/kafka/pull/8376#discussion_r427535098



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
##########
@@ -1098,8 +1098,20 @@ Node selectReadReplica(TopicPartition partition, Node leaderReplica, long curren
         Map<Node, FetchSessionHandler.Builder> fetchable = new LinkedHashMap<>();
 
         // Ensure the position has an up-to-date leader
-        subscriptions.assignedPartitions().forEach(
-            tp -> subscriptions.maybeValidatePositionForCurrentLeader(tp, metadata.currentLeader(tp)));
+        subscriptions.assignedPartitions().forEach(tp -> {
+            Metadata.LeaderAndEpoch leaderAndEpoch = metadata.currentLeader(tp);
+            if (leaderAndEpoch.leader.isPresent()) {
+                NodeApiVersions nodeApiVersions = apiVersions.get(leaderAndEpoch.leader.get().idString());

Review comment:
       Yes, that makes sense to me.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org