jolshan commented on a change in pull request #9944: URL: https://github.com/apache/kafka/pull/9944#discussion_r627522339
########## File path: clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java ########## @@ -212,10 +273,19 @@ public FetchRequestData build() { nextMetadata, node, partitionsToLogString(next.keySet())); } sessionPartitions = next; + sessionTopicIds = topicIds; + topicIds.forEach((name, id) -> sessionTopicNames.put(id, name)); next = null; + topicIds = null; + requestUsedTopicIds = sessionTopicIds.keySet().containsAll(sessionPartitions.keySet().stream().map( + tp -> tp.topic()).collect(Collectors.toSet())); Map<TopicPartition, PartitionData> toSend = - Collections.unmodifiableMap(new LinkedHashMap<>(sessionPartitions)); - return new FetchRequestData(toSend, Collections.emptyList(), toSend, nextMetadata); + Collections.unmodifiableMap(new LinkedHashMap<>(sessionPartitions)); + Map<String, Uuid> toSendTopicIds = + Collections.unmodifiableMap(new HashMap<>(sessionTopicIds)); + Map<Uuid, String> toSendTopicNames = Review comment: Would this work if we added a new topic to the session? I would think that we would need to add the new topic's info and the map is unmodifiable. Please correct me if this is not the case. -- 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