Github user shubhamchopra commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14412#discussion_r99189219
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -1152,20 +1185,25 @@ private[spark] class BlockManager(
     
         val startTime = System.nanoTime
     
    -    var peersReplicatedTo = mutable.HashSet.empty[BlockManagerId]
    +    var peersReplicatedTo = mutable.HashSet.empty ++ existingReplicas
         var peersFailedToReplicateTo = mutable.HashSet.empty[BlockManagerId]
         var numFailures = 0
     
    +    val initialPeers = {
    +      val peers = getPeers(false)
    +      if(existingReplicas.isEmpty) peers else 
peers.filter(!existingReplicas.contains(_))
    +    }
    +
         var peersForReplication = blockReplicationPolicy.prioritize(
           blockManagerId,
    -      getPeers(false),
    -      mutable.HashSet.empty,
    +      initialPeers,
    +      peersReplicatedTo,
           blockId,
           numPeersToReplicateTo)
     
         while(numFailures <= maxReplicationFailures &&
    -        !peersForReplication.isEmpty &&
    -        peersReplicatedTo.size != numPeersToReplicateTo) {
    +      !peersForReplication.isEmpty &&
    +      peersReplicatedTo.size < numPeersToReplicateTo) {
    --- End diff --
    
    One scenario I can think of is if an executor with the block being 
replicated is lost (due to say a delayed heartbeat) and joins back again. The 
current implementation would recognize the block manager needs to reregister 
and will report all blocks. The probability of this happening increases with 
pro-active replication, I think.


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

Reply via email to