You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "bozhang2820 (via GitHub)" <gi...@apache.org> on 2023/09/06 12:10:12 UTC
[GitHub] [spark] bozhang2820 commented on a diff in pull request #42296: [SPARK-44635][CORE] Handle shuffle fetch failures in decommissions
bozhang2820 commented on code in PR #42296:
URL: https://github.com/apache/spark/pull/42296#discussion_r1317184031
##########
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:
##########
@@ -264,18 +272,22 @@ final class ShuffleBlockFetcherIterator(
case FetchBlockInfo(blockId, size, mapIndex) => (blockId.toString, (size, mapIndex))
}.toMap
val remainingBlocks = new HashSet[String]() ++= infoMap.keys
- val deferredBlocks = new ArrayBuffer[String]()
+ val deferredBlocks = new HashMap[BlockManagerId, Queue[String]]()
val blockIds = req.blocks.map(_.blockId.toString)
val address = req.address
val requestStartTime = clock.nanoTime()
@inline def enqueueDeferredFetchRequestIfNecessary(): Unit = {
if (remainingBlocks.isEmpty && deferredBlocks.nonEmpty) {
- val blocks = deferredBlocks.map { blockId =>
- val (size, mapIndex) = infoMap(blockId)
- FetchBlockInfo(BlockId(blockId), size, mapIndex)
+ val newAddressToBlocks = new HashMap[BlockManagerId, Queue[FetchBlockInfo]]()
+ deferredBlocks.foreach { case (blockManagerId, blockIds) =>
+ val blocks = blockIds.map { blockId =>
+ val (size, mapIndex) = infoMap(blockId)
+ FetchBlockInfo(BlockId(blockId), size, mapIndex)
+ }
+ newAddressToBlocks.put(blockManagerId, blocks)
}
Review Comment:
The original definition for `DeferFetchRequestResult` has only one address, and here we changed it to contain both the addresses before and after the refresh (due to shuffle block migrations).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org