Skip to content

Commit 6609c2a

Browse files
committed
Unconditionally update master's block status when handling invalid request.
1 parent aa75e2d commit 6609c2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/main/scala/org/apache/spark/storage/BlockManager.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,12 @@ private[spark] class BlockManager(
280280
} else {
281281
getLocalBytes(blockId) match {
282282
case Some(buffer) => new BlockManagerManagedBuffer(blockInfoManager, blockId, buffer)
283-
case None => throw new BlockNotFoundException(blockId.toString)
283+
case None =>
284+
// If this block manager receives a request for a block that it doesn't have then it's
285+
// likely that the master has outdated block statuses for this block. Therefore, we send
286+
// an RPC so that this block is marked as being unavailable from this block manager.
287+
reportBlockStatus(blockId, BlockStatus.empty)
288+
throw new BlockNotFoundException(blockId.toString)
284289
}
285290
}
286291
}

0 commit comments

Comments
 (0)