holdenk commented on a change in pull request #26440: [WIP][SPARK-20628][CORE] 
Start to improve Spark decommissioning & preemption support
URL: https://github.com/apache/spark/pull/26440#discussion_r345297219
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/master/Master.scala
 ##########
 @@ -243,6 +243,15 @@ private[deploy] class Master(
       logError("Leadership has been revoked -- master shutting down.")
       System.exit(0)
 
+    case WorkerDecommission(id, workerRef) =>
+      logInfo("Recording worker %s decommissioning".format(id))
+      if (state == RecoveryState.STANDBY) {
+        workerRef.send(MasterInStandby)
+      } else {
+        // If a worker attempts to decommission that isn't registered ignore 
it.
+        idToWorker.get(id).foreach(decommissionWorker)
 
 Review comment:
   So the get returns an option and we use `foreach` instead of `getOrElse`, 
but I'll the comment to make that clearer.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to