chia7712 commented on code in PR #19577:
URL: https://github.com/apache/kafka/pull/19577#discussion_r2246169001


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -747,10 +757,12 @@ public void onResponse(final ClientResponse response) {
             long currentTimeMs = response.receivedTimeMs();
             OffsetCommitResponse commitResponse = (OffsetCommitResponse) 
response.responseBody();
             Set<String> unauthorizedTopics = new HashSet<>();
+            Set<Uuid> unknownTopicIds = new HashSet<>();
             boolean failedRequestRegistered = false;
             for (OffsetCommitResponseData.OffsetCommitResponseTopic topic : 
commitResponse.data().topics()) {
+                String topicName = 
metadata.topicNames().getOrDefault(topic.topicId(), topic.name());
                 for (OffsetCommitResponseData.OffsetCommitResponsePartition 
partition : topic.partitions()) {
-                    TopicPartition tp = new TopicPartition(topic.name(), 
partition.partitionIndex());
+                    TopicPartition tp = new TopicPartition(topicName, 
partition.partitionIndex());

Review Comment:
   `topic.name()` will be empty if the version is earlier then `v10`, and 
`metadata` might not contain topic name for `topic.topicId()` if the topic has 
been recreated. this scenario is similar to #19964, and perhaps we should throw 
an exception if `offsets` can't retrieve `OffsetAndMetadata`.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -797,6 +809,9 @@ public void onResponse(final ClientResponse response) {
                     } else if (error == Errors.TOPIC_AUTHORIZATION_FAILED) {
                         // Collect all unauthorized topics before failing
                         unauthorizedTopics.add(tp.topic());
+                    } else if (error == Errors.UNKNOWN_TOPIC_ID) {
+                        // Collect all unknown topic ids

Review Comment:
   why to not complete the future and then return? I assume the behavior is 
analogous to `UNKNOWN_TOPIC_OR_PARTITION`.



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