Uh oh!
There was an error while loading. Please reload this page.
[SPARK-2635] Fix race condition at SchedulerBackend.isReady in standalone mode - #1525
[SPARK-2635] Fix race condition at SchedulerBackend.isReady in standalone mode#1525li-zhihui wants to merge 5 commits into
Conversation
AmplabJenkins
commented
Jul 22, 2014
Can one of the admins verify this patch? |
li-zhihui
commented
Jul 22, 2014
There was a problem hiding this comment.
// Submit tasks time(milliseconds) after minRegisteredRatio is reached
There was a problem hiding this comment.
Thanks @markhamstra , but I think the code means that submit tasks time if minRegisteredRatio is not reached.
There was a problem hiding this comment.
Ah, I see -- sorry. Looks like this is what we want? // Submit tasks after maxRegisteredWaitingTime milliseconds if minRegisteredRatio has not yet been reached
tgravescs
commented
Jul 23, 2014
can you please also file a jira for this |
tgravescs
commented
Jul 23, 2014
Jenkins, test this please |
SparkQA
commented
Jul 23, 2014
QA tests have started for PR 1525. This patch merges cleanly. |
SparkQA
commented
Jul 23, 2014
QA results for PR 1525: |
There was a problem hiding this comment.
Looks like minRegisteredRatio is only needed within this class and doesn't need to be a var:
privatevalminRegisteredRatio= math.min(1, conf.getDouble("spark.scheduler.minRegisteredResourcesRatio", 0))There was a problem hiding this comment.
...actually, it doesn't look like it's used at all anymore except in a log message.
There was a problem hiding this comment.
Sorry, was doing something dumb. Leave it a var but clean up the initialization.
There was a problem hiding this comment.
Thanks @markhamstra the var member also is used in https://github.com/apache/spark/pull/1525/files#diff-ae6a41a938a767e5bb97b5d738371a5bR34
math.min is a good way.
li-zhihui
commented
Jul 23, 2014
I add a new commit, @tgravescs@markhamstra |
There was a problem hiding this comment.
I'd do these two log messages with string interpolation instead of using +. http://docs.scala-lang.org/overviews/core/string-interpolation.html
tgravescs
commented
Jul 23, 2014
Jenkins, this is okay to test |
tgravescs
commented
Jul 23, 2014
Jenkins, test this please |
SparkQA
commented
Jul 23, 2014
QA tests have started for PR 1525. This patch merges cleanly. |
SparkQA
commented
Jul 23, 2014
QA results for PR 1525: |
There was a problem hiding this comment.
Why "getAndSet" here instead of just "set"?
kayousterhout
commented
Jul 23, 2014
I find it a bit confusing that "totalRegisteredResources" can refer to cores (in standalone mode) or executors (in Yarn mode). Can we just use different variables in each of the two cases and name them appropriately (so totalRegisteredCores and totalRegisteredExecutors)? |
li-zhihui
commented
Jul 24, 2014
@kayousterhout I guess your meaning is "totalExpectedResources" (no variable "totalRegisteredResources"). Now totalRegisteredCores is totalCoreCount, and totalRegisteredExecutors is totalExecutors. |
li-zhihui
commented
Jul 24, 2014
@kayousterhout I think using totalExpectedCores and totalExpectedExecutors replacing totalExpectedResources is a good idea, thanks. |
li-zhihui
commented
Jul 24, 2014
@tgravescs@kayousterhout I add a new commit. |
li-zhihui
commented
Aug 1, 2014
@tgravescs@kayousterhout can you close this PR before code frozen of 1.1 release? Otherwise, it would result in incompatible configuration property name because the PR rename |
kayousterhout
commented
Aug 1, 2014
I will take a look at this tomorrow. On Thu, Jul 31, 2014 at 10:37 PM, Zhihui Li notifications@github.com
|
There was a problem hiding this comment.
nit: make this one line with the one above
There was a problem hiding this comment.
one more nit: can we call this totalRegisteredExecutors?
pwendell
commented
Aug 2, 2014
Hey all @kayousterhout asked me to look at this. To me, doesn't make semantic sense to expose If users in standalone mode want to wait, for now they should add their own code to sleep until the number of desired executors appears. They can do this by calling Also curious what @mateiz and @aarondav think about this. I haven't been following this patch previously. |
pwendell
commented
Aug 2, 2014
I guess this currently is disabled by default, so that's good (it won't break behavior) but I still don't think |
kayousterhout
commented
Aug 2, 2014
My preference is also to remove this for standalone mode (as mentioned in the original PR, #900) -- but adding @tgravescs who looked quite a bit at the original PR to see if we're forgetting something important here! |
li-zhihui
commented
Aug 2, 2014
tnachen
commented
Aug 2, 2014
If what @pwendell said is true about sparks.core.max then I think probably need to rethink how to approach this regardless what mode we're in. I think I gears towards safety first since this is just an optimization. |
li-zhihui
commented
Aug 4, 2014
As @pwendell says, the configuration |
tnachen
commented
Aug 4, 2014
I see, the max waiting time does mitigate this. I think minimally probably worth commenting on the configuration to warn the potential hanging and the max timeout will not allow the scheduler to wait forever. |
pwendell
commented
Aug 7, 2014
Jenkins, test this please. |
SparkQA
commented
Aug 7, 2014
QA tests have started for PR 1525. This patch merges cleanly. |
SparkQA
commented
Aug 7, 2014
QA results for PR 1525: |
tgravescs
commented
Aug 7, 2014
We should figure out before we release 1.1 which we are going to support this on and make sure the config name is good. I'm fine either way as long as it works on the yarn side. |
kayousterhout
commented
Aug 7, 2014
I think the verdict here is to leave this feature in, and this patch looks On Thu, Aug 7, 2014 at 1:54 PM, Tom Graves notifications@github.com wrote:
|
tgravescs
commented
Aug 8, 2014
Changes look good to me. |
pwendell
commented
Aug 9, 2014
Okay cool LGTM too... after some thought I'm okay to leave it in. The name right now is a bit awkward, but I don't see a better option at this point. Thanks @kayousterhout and @tgravescs for looking at this. |
…lone mode In SPARK-1946(PR #900), configuration <code>spark.scheduler.minRegisteredExecutorsRatio</code> was introduced. However, in standalone mode, there is a race condition where isReady() can return true because totalExpectedExecutors has not been correctly set. Because expected executors is uncertain in standalone mode, the PR try to use CPU cores(<code>--total-executor-cores</code>) as expected resources to judge whether SchedulerBackend is ready. Author: li-zhihui <zhihui.li@intel.com> Author: Li Zhihui <zhihui.li@intel.com> Closes#1525 from li-zhihui/fixre4s and squashes the following commits: e9a630b [Li Zhihui] Rename variable totalExecutors and clean codes abf4860 [Li Zhihui] Push down variable totalExpectedResources to children classes ca54bd9 [li-zhihui] Format log with String interpolation 88c7dc6 [li-zhihui] Few codes and docs refactor 41cf47e [li-zhihui] Fix race condition at SchedulerBackend.isReady in standalone mode (cherry picked from commit 28dbae8) Signed-off-by: Patrick Wendell <pwendell@gmail.com>
…lone mode In SPARK-1946(PR apache#900), configuration <code>spark.scheduler.minRegisteredExecutorsRatio</code> was introduced. However, in standalone mode, there is a race condition where isReady() can return true because totalExpectedExecutors has not been correctly set. Because expected executors is uncertain in standalone mode, the PR try to use CPU cores(<code>--total-executor-cores</code>) as expected resources to judge whether SchedulerBackend is ready. Author: li-zhihui <zhihui.li@intel.com> Author: Li Zhihui <zhihui.li@intel.com> Closesapache#1525 from li-zhihui/fixre4s and squashes the following commits: e9a630b [Li Zhihui] Rename variable totalExecutors and clean codes abf4860 [Li Zhihui] Push down variable totalExpectedResources to children classes ca54bd9 [li-zhihui] Format log with String interpolation 88c7dc6 [li-zhihui] Few codes and docs refactor 41cf47e [li-zhihui] Fix race condition at SchedulerBackend.isReady in standalone mode
In SPARK-1946(PR #900), configuration
spark.scheduler.minRegisteredExecutorsRatiowas introduced. However, in standalone mode, there is a race condition where isReady() can return true because totalExpectedExecutors has not been correctly set.Because expected executors is uncertain in standalone mode, the PR try to use CPU cores(
--total-executor-cores) as expected resources to judge whether SchedulerBackend is ready.