xkrogen commented on a change in pull request #33446:
URL: https://github.com/apache/spark/pull/33446#discussion_r674982375



##########
File path: 
core/src/main/scala/org/apache/spark/storage/PushBasedFetchHelper.scala
##########
@@ -138,10 +140,19 @@ private class PushBasedFetchHelper(
         ((shuffleBlockId.shuffleId, shuffleBlockId.reduceId), size)
     }.toMap
     val address = req.address
+    var remainingBlockCount = sizeMap.size
+    val requestStartTime = clock.nanoTime()
+
     val mergedBlocksMetaListener = new MergedBlocksMetaListener {
       override def onSuccess(shuffleId: Int, reduceId: Int, meta: 
MergedBlockMeta): Unit = {
         logInfo(s"Received the meta of push-merged block for ($shuffleId, 
$reduceId)  " +
           s"from ${req.address.host}:${req.address.port}")
+        remainingBlockCount -= 1
+        if (remainingBlockCount == 0) {
+          iterator.logFetchIfSlow(
+            TimeUnit.NANOSECONDS.toMillis(clock.nanoTime() - requestStartTime),
+            sizeMap.values.sum, sizeMap.size, address)
+        }

Review comment:
       > I think we check `remainingBlock==0` to know when the network request 
(containing multiple blocks) is done.
   
   Yes, that's right.
   
   I also agree that we shouldn't be checking for slowness in the metadata 
request. @otterc, it seems all of the methods in `PushBasedFetchHelper` for 
fetching merged blocks are specifically for local ones, is there somewhere we 
fetch remote merged blocks that we should be logging slowness?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to