wankunde commented on code in PR #37922:
URL: https://github.com/apache/spark/pull/37922#discussion_r973864857
##########
core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:
##########
@@ -1395,16 +1393,24 @@ private[spark] class DAGScheduler(
}
private def getAndSetShufflePushMergerLocations(stage: ShuffleMapStage):
Seq[BlockManagerId] = {
- val mergerLocs = sc.schedulerBackend.getShufflePushMergerLocations(
- stage.shuffleDep.partitioner.numPartitions, stage.resourceProfileId)
- if (mergerLocs.nonEmpty) {
- stage.shuffleDep.setMergerLocs(mergerLocs)
+ stage.shuffleDep.synchronized {
+ val oldMergeLocs = stage.shuffleDep.getMergerLocs
+ if (oldMergeLocs.isEmpty) {
+ val mergerLocs = sc.schedulerBackend.getShufflePushMergerLocations(
+ stage.shuffleDep.partitioner.numPartitions, stage.resourceProfileId)
+ if (mergerLocs.nonEmpty) {
+ stage.shuffleDep.setMergerLocs(mergerLocs)
+ mapOutputTracker.registerShufflePushMergerLocations(
+ stage.shuffleDep.shuffleId, mergerLocs)
+ }
+ logDebug(s"Shuffle merge locations for shuffle
${stage.shuffleDep.shuffleId} with" +
+ s" shuffle merge ${stage.shuffleDep.shuffleMergeId} is" +
+ s" ${stage.shuffleDep.getMergerLocs.map(_.host).mkString(", ")}")
+ mergerLocs
+ } else {
+ oldMergeLocs
+ }
}
-
- logDebug(s"Shuffle merge locations for shuffle
${stage.shuffleDep.shuffleId} with" +
- s" shuffle merge ${stage.shuffleDep.shuffleMergeId} is" +
- s" ${stage.shuffleDep.getMergerLocs.map(_.host).mkString(", ")}")
- mergerLocs
}
Review Comment:
done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]