DL1231 commented on code in PR #20768:
URL: https://github.com/apache/kafka/pull/20768#discussion_r2479958965


##########
core/src/main/scala/kafka/server/DelayedFetch.scala:
##########
@@ -154,9 +154,9 @@ class DelayedFetch(
    * Upon completion, read whatever data is available and pass to the complete 
callback
    */
   override def onComplete(): Unit = {
-    val fetchInfos = fetchPartitionStatus.map { case (tp, status) =>
+    val fetchInfos = fetchPartitionStatus.asScala.map { case (tp, status) =>
       tp -> status.fetchInfo
-    }
+    }.toSeq

Review Comment:
   The source of `fetchPartitionStatus` comes from `fetchData()`.
   
https://github.com/apache/kafka/blob/53e117253d21b2cd00e69d6ab91dae0ee84432f2/clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java#L395-L420
   Its type is `LinkedHashMap<TopicIdPartition, PartitionData>`, so there will 
be no duplicate TPs.



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