chickenchickenlove commented on code in PR #21127:
URL: https://github.com/apache/kafka/pull/21127#discussion_r2751252048


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java:
##########
@@ -783,8 +785,23 @@ private 
CompletableFuture<OffsetsForLeaderEpochUtils.OffsetForEpochResult> build
             final Node node,
             final Map<TopicPartition, SubscriptionState.FetchPosition> 
fetchPositions,
             List<NetworkClientDelegate.UnsentRequest> unsentRequests) {
+        // Convert TopicPartition to TopicIdPartition
+        Map<TopicIdPartition, SubscriptionState.FetchPosition> 
fetchPositionsWithId = new HashMap<>();
+        Map<String, Uuid> topicIds = metadata.topicIds();
+        fetchPositions.forEach((tp, position) -> {
+            Uuid topicId = topicIds.get(tp.topic());
+            if (topicId != null) {
+                TopicIdPartition tip = new TopicIdPartition(topicId, 
tp.partition(), tp.topic());
+                fetchPositionsWithId.put(tip, position);
+            } else {
+                // Topic ID not available yet, skip this partition for now
+                // The metadata will be refreshed and we'll retry
+                log.debug("Skipping offset validation for partition {} because 
topic ID is not available in metadata", tp);
+            }
+        });

Review Comment:
   Same as above



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to