dajac commented on code in PR #13378:
URL: https://github.com/apache/kafka/pull/13378#discussion_r1132490026


##########
core/src/main/scala/kafka/coordinator/group/GroupCoordinatorAdapter.scala:
##########
@@ -388,18 +393,27 @@ private[group] class GroupCoordinatorAdapter(
       case retentionTimeMs => Some(currentTimeMs + retentionTimeMs)
     }
 
-    val partitions = new mutable.HashMap[TopicPartition, OffsetAndMetadata]()
+    val topicIds = metadata.topicNamesToIds()
+    val partitions = new mutable.HashMap[TopicIdPartition, OffsetAndMetadata]()
     request.topics.forEach { topic =>
-      topic.partitions.forEach { partition =>
-        val tp = new TopicPartition(topic.name, partition.partitionIndex)
-        partitions += tp -> createOffsetAndMetadata(
-          currentTimeMs,
-          partition.committedOffset,
-          partition.committedLeaderEpoch,
-          partition.committedMetadata,
-          partition.commitTimestamp,
-          expireTimeMs
-        )
+      val topicId = topicIds.get(topic.name)
+      if (Uuid.ZERO_UUID.equals(topicId)) {
+        val topicPartitions = topic.partitions.asScala.map { p =>
+          new TopicPartition(topic.name, p.partitionIndex) -> 
Errors.UNKNOWN_TOPIC_OR_PARTITION
+        }
+        appendToResponse(topicPartitions.toMap)
+      } else {

Review Comment:
   This is not needed as well as it will be done in the KafkaApis layer. We 
should just take the topic id that we receive here and use it to create the 
`TopicIdPartition`. Obviously, it will always be `ZERO_UUID` at the moment.



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