jolshan commented on a change in pull request #11331: URL: https://github.com/apache/kafka/pull/11331#discussion_r745010308
########## 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: Do we need to reassign to empty map here? -- 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