-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-10582] If a new AM restarts, the total number of executors should be in initial state in driver side. #8737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,6 +232,14 @@ private[spark] class ExecutorAllocationManager( | |
| executor.scheduleAtFixedRate(scheduleTask, 0, intervalMillis, TimeUnit.MILLISECONDS) | ||
| } | ||
|
|
||
| /** | ||
| * Change the value of numExecutorsTarget. | ||
| */ | ||
| def reSetNumExecutorsTarget(): Unit = { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reset ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just call this |
||
| logDebug(s"Now reset the value of numExecutorsTarget.") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation is off |
||
| numExecutorsTarget = conf.getInt("spark.dynamicAllocation.initialExecutors", minNumExecutors) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly what's going on, this will result in Instead, wouldn't it be clearer to just explicitly send a message to the AM saying "this is the current state of the world, initialize yourself to deal with it"? Maybe as a reply to the Also,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think we should reset on the driver side as this patch has done, since we end up calling |
||
| } | ||
|
|
||
| /** | ||
| * Stop the allocation manager. | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,7 @@ private[spark] abstract class YarnSchedulerBackend( | |
| filterParams.foreach { case (k, v) => conf.set(s"spark.$filterName.param.$k", v) } | ||
| scheduler.sc.ui.foreach { ui => JettyUtils.addFilters(ui.getHandlers, conf) } | ||
| } | ||
| scheduler.sc.executorAllocationManager.foreach(_.reSetNumExecutorsTarget()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this should go into some other place. you've put it here into
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this whole change needs a better explanation. At a high leve, why does it occur and why is this the right fix? This doesn't look right
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My way is: if a new AM is started, the value of numExecutorsTarget is reset. So the total number of executor will be calculated again, and driver will send RequestExecutors to AM to start execuots.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is not good to add this line of change here. I think your purpose is to detect whether the AM is reconnected, right? There's are many other ways for you to detect it, adding here is a little weird.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| override def createDriverEndpoint(properties: Seq[(String, String)]): DriverEndpoint = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too vague...