mridulm commented on a change in pull request #30164:
URL: https://github.com/apache/spark/pull/30164#discussion_r521627964
##########
File path:
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -657,6 +681,28 @@ class BlockManagerMasterEndpoint(
}
}
+ private def getShufflePushMergerLocations(
+ numMergersNeeded: Int,
+ hostsToFilter: Set[String]): Seq[BlockManagerId] = {
+ val activeBlockManagers = blockManagerIdByExecutor.groupBy(_._2.host)
+ .mapValues(_.head).values.map(_._2).toSet
+ val filteredActiveBlockManagers = activeBlockManagers
+ .filterNot(x => hostsToFilter.contains(x.host))
+ val filteredActiveMergers = filteredActiveBlockManagers.map(
+ x => BlockManagerId(x.executorId, x.host,
StorageUtils.externalShuffleServicePort(conf)))
+
+ // Enough mergers are available as part of active executors list
+ if (filteredActiveMergers.size >= numMergersNeeded) {
+ filteredActiveMergers.toSeq
+ } else {
+ // Delta mergers added from inactive mergers list to the active mergers
list
+ val filteredDeadMergers = shuffleMergerLocations.values
+ .filterNot(mergerHost => filteredActiveMergers.exists(x => x.host ==
mergerHost.host))
+ filteredActiveMergers.toSeq ++
+ filteredDeadMergers.toSeq.take(numMergersNeeded -
filteredActiveMergers.size)
Review comment:
We are already prioritizing hosts with active executors - this is making
up the remaining in case number of merger hosts with active executors is not
sufficient.
I was trying to understand the behavior ... random order might be better
instead of preferring the head or tail of this map. Thoughts @tgravescs ?
----------------------------------------------------------------
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]