dajac commented on code in PR #12897:
URL: https://github.com/apache/kafka/pull/12897#discussion_r1034773867


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java:
##########
@@ -346,8 +346,10 @@ public void onFailure(RuntimeException e) {
                             FetchSessionHandler handler = 
sessionHandler(fetchTarget.id());
                             if (handler != null) {
                                 handler.handleError(e);
+                                
handler.sessionTopicPartitions().forEach(subscriptions::clearPreferredReadReplica);
                             }
                         } finally {
+                            metadata.requestUpdate();

Review Comment:
   In `NetworkClient.processDisconnection`, it seems that we request refreshing 
metadata upon connection issues. 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java:
##########
@@ -1944,4 +1946,9 @@ private Set<String> 
topicsForPartitions(Collection<TopicPartition> partitions) {
         return 
partitions.stream().map(TopicPartition::topic).collect(Collectors.toSet());
     }
 
+    private void prepareMetadataRefresh(TopicPartition topicPartition) {

Review Comment:
   nit: `requestMetadataUpdateAndClearPreferredReadReplica` or 
`requestMetadataUpdate`?



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