Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14412#discussion_r101447632
--- Diff:
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
---
@@ -195,17 +198,39 @@ class BlockManagerMasterEndpoint(
// Remove it from blockManagerInfo and remove all the blocks.
blockManagerInfo.remove(blockManagerId)
+
val iterator = info.blocks.keySet.iterator
while (iterator.hasNext) {
val blockId = iterator.next
val locations = blockLocations.get(blockId)
locations -= blockManagerId
if (locations.size == 0) {
blockLocations.remove(blockId)
+ logWarning(s"No more replicas available for $blockId !")
+ } else if (proactivelyReplicate && (blockId.isRDD ||
blockId.isInstanceOf[TestBlockId])) {
+ // only RDD blocks store data that users explicitly cache so we
only need to proactively
+ // replicate RDD blocks
+ // broadcast related blocks exist on all executors, so we don't
worry about them
+ // we also need to replicate this behavior for test blocks for
unit tests
+ // we send a message to a randomly chosen executor location to
replicate block
+ // assuming single executor failure, we find out how many replicas
existed before failure
+ val maxReplicas = locations.size + 1
+
+ val i = (new Random(blockId.hashCode)).nextInt(locations.size)
--- End diff --
Why do we need to use a fixed random seed here? Testing?
Also, isn't there a `Random.choice()` that you can use for this? Or a
method like that in our own `Utils` class?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]