Ngone51 commented on a change in pull request #33649:
URL: https://github.com/apache/spark/pull/33649#discussion_r683271456



##########
File path: core/src/main/scala/org/apache/spark/shuffle/ShuffleBlockPusher.scala
##########
@@ -242,10 +242,16 @@ private[spark] class ShuffleBlockPusher(conf: SparkConf) 
extends Logging {
         handleResult(PushResult(blockId, exception))
       }
     }
+    // In addition to randomizing the order of the push requests, further 
randomize the order
+    // of blocks within the push request to further reduce the likelihood of 
shuffle server side
+    // collision of pushed blocks. This does not increase the cost of reading 
unmerged shuffle
+    // files on the executor side, because we are still reading MB-size chunks 
and only randomize
+    // the in-memory sliced buffers post reading.
+    val blocksToPush = Utils.randomize(blockIds.zip(
+      sliceReqBufferIntoBlockBuffers(request.reqBuffer, 
request.blocks.map(_._2))))
     SparkEnv.get.blockManager.blockStoreClient.pushBlocks(
-      address.host, address.port, blockIds.toArray,
-      sliceReqBufferIntoBlockBuffers(request.reqBuffer, 
request.blocks.map(_._2)),
-      blockPushListener)
+      address.host, address.port, blocksToPush.map(_._1).toArray,
+      blocksToPush.map(_._2).toArray, blockPushListener)

Review comment:
       ```suggestion
         address.host, address.port, blockPushIdsToPush.toArray,
         blockPushBuffers.toArray, blockPushListener)
   ```




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