wankunde commented on code in PR #37922:
URL: https://github.com/apache/spark/pull/37922#discussion_r1067809378


##########
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala:
##########
@@ -321,6 +321,12 @@ class BlockManagerMasterEndpoint(
   }
 
   private def removeShuffle(shuffleId: Int): Future[Seq[Boolean]] = {
+    val mergerLocations =
+      if (Utils.isPushBasedShuffleEnabled(conf, isDriver)) {
+        mapOutputTracker.getShufflePushMergerLocations(shuffleId)
+      } else {
+        Seq.empty[BlockManagerId]
+      }

Review Comment:
   1.  BlockManagerMaster is also registered as a BlockManagerInfo
   ```
   SparkContext: _env.blockManager.initialize(_applicationId)
   BlockManager:
   
       val idFromMaster = master.registerBlockManager(
         id,
         diskBlockManager.localDirsString,
         maxOnHeapMemory,
         maxOffHeapMemory,
         storageEndpoint)
   ```
   
   2. BlockManagerMaster receive RemoveShuffle RPC and remove all the shuffle 
data in MapOutputTrackerMaster
   ```
   BlockManagerStorageEndpoint:
       case RemoveShuffle(shuffleId) =>
         doAsync[Boolean]("removing shuffle " + shuffleId, context) {
           if (mapOutputTracker != null) {
             logWarning(s"Call mapOutputTracker.unregisterShuffle for 
$shuffleId")
             mapOutputTracker.unregisterShuffle(shuffleId)
           }
   -----------
   MapOutputTrackerMaster:
     def unregisterShuffle(shuffleId: Int): Unit = {
       shuffleStatuses.remove(shuffleId).foreach { shuffleStatus =>
   ....
   ```
   3.  No shuffle status in MapOutputTracker:
   ```
   BlockManagerMasterEndpoint:
   
       val mergerLocations =
         if (Utils.isPushBasedShuffleEnabled(conf, isDriver)) {
           mapOutputTracker.getShufflePushMergerLocations(shuffleId)
         } else {
           Seq.empty[BlockManagerId]
         }
   
   ---------------
   MapOutputTrackerMaster:
   
     override def getShufflePushMergerLocations(shuffleId: Int): 
Seq[BlockManagerId] = {
       
logWarning("shuffleStatuses.get(shuffleId).map(_.getShufflePushMergerLocations) 
= " +
         
s"${shuffleStatuses.get(shuffleId).map(_.getShufflePushMergerLocations)}")
       
shuffleStatuses.get(shuffleId).map(_.getShufflePushMergerLocations).getOrElse(Seq.empty)
     }
   ```
   
   4. It seems removeShuffleFromShuffleServicesFutures will also be empty due 
to this reason.
   
   
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L336
   



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