Kimahriman commented on a change in pull request #35085:
URL: https://github.com/apache/spark/pull/35085#discussion_r795056810



##########
File path: 
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -311,16 +313,52 @@ class BlockManagerMasterEndpoint(
   }
 
   private def removeShuffle(shuffleId: Int): Future[Seq[Boolean]] = {
-    // Nothing to do in the BlockManagerMasterEndpoint data structures
+    // Find all shuffle blocks on executors that are no longer running
+    val blocksToDeleteByShuffleService =
+      new mutable.HashMap[BlockManagerId, mutable.HashSet[BlockId]]
+    if (externalBlockStoreClient.isDefined) {
+      mapOutputTracker.shuffleStatuses.get(shuffleId).foreach { shuffleStatus 
=>
+        shuffleStatus.mapStatuses.foreach { mapStatus =>
+          // Port should always be external shuffle port if external shuffle 
is enabled
+          val isShufflePort = mapStatus.location.port == 
externalShuffleServicePort
+          val executorDeallocated =
+            !blockManagerIdByExecutor.contains(mapStatus.location.executorId)
+          if (isShufflePort && executorDeallocated) {
+            val blocks = 
blocksToDeleteByShuffleService.getOrElseUpdate(mapStatus.location,
+              new mutable.HashSet[BlockId])

Review comment:
       good point, updated




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

Reply via email to