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 2022/11/29 14:21:36 UTC
[GitHub] [kafka] dajac commented on a diff in pull request #12897: KAFKA-14379: consumer should refresh preferred read replica on update metadata
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org