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



##########
File path: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
##########
@@ -414,21 +414,23 @@ final class ShuffleBlockFetcherIterator(
         def shouldMergeIntoPreviousBatchBlockId =
           mergedBlockInfo.last.blockId.asInstanceOf[ShuffleBlockBatchId].mapId 
== startBlockId.mapId
 
-        val startReduceId = if (mergedBlockInfo.nonEmpty && 
shouldMergeIntoPreviousBatchBlockId) {
-          // Remove the previous batch block id as we will add a new one to 
replace it.
-          mergedBlockInfo.remove(mergedBlockInfo.length - 1).blockId
-            .asInstanceOf[ShuffleBlockBatchId].startReduceId
-        } else {
-          startBlockId.reduceId
-        }
+        val (startReduceId, size) =
+          if (mergedBlockInfo.nonEmpty && shouldMergeIntoPreviousBatchBlockId) 
{
+            // Remove the previous batch block id as we will add a new one to 
replace it.
+            val removed = mergedBlockInfo.remove(mergedBlockInfo.length - 1)
+              (removed.blockId.asInstanceOf[ShuffleBlockBatchId].startReduceId,
+                removed.size + toBeMerged.map(_.size).sum)
+          } else {
+            (startBlockId.reduceId, toBeMerged.map(_.size).sum)
+          }

Review comment:
       ok, I'll try...




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

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