dajac commented on a change in pull request #11331:
URL: https://github.com/apache/kafka/pull/11331#discussion_r745050242



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java
##########
@@ -340,11 +340,9 @@ public FetchRequestData build() {
             // Add topic IDs to session if we can use them. If an ID is 
inconsistent, we will handle in the receiving broker.
             // If we switched from using topic IDs to not using them (or vice 
versa), that error will also be handled in the receiving broker.
             if (canUseTopicIds) {
-                Map<Uuid, Set<String>> newTopicNames = 
added.stream().collect(Collectors.groupingByConcurrent(TopicIdPartition::topicId,
-                        Collectors.mapping(topicIdPartition -> 
topicIdPartition.topicPartition().topic(), Collectors.toSet())));
-
-                // There should only be one topic name per topic ID.
-                newTopicNames.forEach((topicId, topicNamesSet) -> 
topicNamesSet.forEach(topicName -> sessionTopicNames.put(topicId, topicName)));
+                sessionTopicNames = topicNames;
+            } else {
+                sessionTopicNames = Collections.emptyMap();

Review comment:
       That is a good question. I thought that it is better to empty the map if 
we don't use topic ids instead of keeping a out-of-date mapping. What do you 
think?




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