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



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java
##########
@@ -406,6 +407,10 @@ synchronized void maybeSeekUnvalidated(TopicPartition tp, 
long offset, OffsetRes
         return new HashSet<>(this.assignment.partitionSet());
     }
 
+    public synchronized void forEachAssignedPartition(Consumer<TopicPartition> 
consumer) {

Review comment:
       This is unused

##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
##########
@@ -1142,6 +1156,7 @@ Node selectReadReplica(TopicPartition partition, Node 
leaderReplica, long curren
 
             Optional<Node> leaderOpt = position.currentLeader.leader;
             if (!leaderOpt.isPresent()) {
+                log.info("Requesting metadata update for partition {} since 
the position {} is missing the current leader node", partition, position);

Review comment:
       This feels more like a debug level log to me. Was there a specific 
reason we needed it?

##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
##########
@@ -1120,17 +1123,28 @@ Node selectReadReplica(TopicPartition partition, Node 
leaderReplica, long curren
         }
     }
 
+    /**
+     * If we have seen new metadata (as tracked by {@link 
org.apache.kafka.clients.Metadata#updateVersion()}), then
+     * we should check that all of the assignments have a valid position.
+     */
+    private void maybeValidateAssignments() {

Review comment:
       The name here through me off because of its generality. I think we need 
to work metadata into the name to make it clearer. Maybe 
`validatePositionsOnMetadataChange` or `validatePositionsForLeaderChanges`.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to