Uh oh!
There was an error while loading. Please reload this page.
[3.0][SPARK-32518][CORE] CoarseGrainedSchedulerBackend.maxNumConcurrentTasks should consider all kinds of resources - #29395
Conversation
Ngone51
commented
Aug 10, 2020
ping @cloud-fan@tgravescs |
| ConfigBuilder("spark.testing.skipValidateCores") | ||
| .version("3.1.0") | ||
| .booleanConf | ||
| .createWithDefault(false) |
There was a problem hiding this comment.
These 2 configs are backported from Master branch.
There was a problem hiding this comment.
ditto. This should be 3.0.1 when it comes to branch-3.0, @Ngone51 .
Also, after merging this, please update master branch consistently.
There was a problem hiding this comment.
Thank you @dongjoon-hyun for letting me know. I was wondering about it previously.
SparkQA
commented
Aug 10, 2020
Test build #127268 has finished for PR 29395 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| .collect() | ||
| } | ||
| assert(exception.getMessage.contains("[SPARK-24819]: Barrier execution " + | ||
| "mode does not allow run a barrier stage that requires more slots")) |
There was a problem hiding this comment.
I'm not sure if its worth it but it would be nice to perhaps print what the limiting resource is. If its to much change or work to track we may just skip it.
There was a problem hiding this comment.
This actually a good idea. But as you mentioned, I'm afraid this needs much more changes. So, I'd like to skip it here.
There was a problem hiding this comment.
ok, we can revisit if it becomes an issue later.
SparkQA
commented
Aug 11, 2020
Test build #127324 has finished for PR 29395 at commit
|
Ngone51
commented
Aug 12, 2020
@tgravescs@clockfly Is it looks OK now? |
| .createWithDefault(2) | ||
| val RESOURCES_WARNING_TESTING = ConfigBuilder("spark.resources.warnings.testing") | ||
| .version("3.1.0") |
There was a problem hiding this comment.
This should be 3.0.1 when it comes to branch-3.0, @Ngone51 .
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Please config version properly.
SparkQA
commented
Aug 14, 2020
Test build #127436 has finished for PR 29395 at commit
|
Ngone51
commented
Aug 14, 2020
retest this please. |
SparkQA
commented
Aug 14, 2020
Test build #127442 has finished for PR 29395 at commit
|
cloud-fan
commented
Aug 14, 2020
retest this please |
SparkQA
commented
Aug 14, 2020
Test build #127450 has finished for PR 29395 at commit
|
tgravescs
commented
Aug 14, 2020
test this please |
SparkQA
commented
Aug 14, 2020
Test build #127458 has finished for PR 29395 at commit
|
Ngone51
commented
Aug 15, 2020
retest this please |
SparkQA
commented
Aug 15, 2020
Test build #127473 has finished for PR 29395 at commit
|
Ngone51
commented
Aug 17, 2020
retest this please. |
SparkQA
commented
Aug 17, 2020
Test build #127496 has finished for PR 29395 at commit
|
|
Ngone51
commented
Aug 17, 2020
retest this please. |
Ngone51
commented
Aug 17, 2020
Seems like we need to wait for this fix: #29448 |
SparkQA
commented
Aug 17, 2020
Test build #127498 has finished for PR 29395 at commit
|
9c18479 to
daa205dCompareSparkQA
commented
Aug 18, 2020
Test build #127519 has finished for PR 29395 at commit
|
thanks, merging to 3.0! |
…ntTasks should consider all kinds of resources ### What changes were proposed in this pull request? 1. Make `CoarseGrainedSchedulerBackend.maxNumConcurrentTasks()` considers all kinds of resources when calculating the max concurrent tasks 2. Refactor `calculateAvailableSlots()` to make it be able to be used for both `CoarseGrainedSchedulerBackend` and `TaskSchedulerImpl` ### Why are the changes needed? Currently, `CoarseGrainedSchedulerBackend.maxNumConcurrentTasks()` only considers the CPU for the max concurrent tasks. This can cause the application to hang when a barrier stage requires extra custom resources but the cluster doesn't have enough corresponding resources. Because, without the checking for other custom resources in `maxNumConcurrentTasks`, the barrier stage can be submitted to the `TaskSchedulerImpl`. But the `TaskSchedulerImpl` won't launch tasks for the barrier stage due to the insufficient task slots calculated by `TaskSchedulerImpl.calculateAvailableSlots` (which does check all kinds of resources). If the barrier stage doesn't launch all the tasks in one true, the application will fail and suggest user to disable delay scheduling. However, this actually a misleading suggestion since the real root cause is not enough resources. ### Does this PR introduce _any_ user-facing change? Yes. In case of a barrier stage requires more custom resources than the cluster has, previously, the application will fail with misleading suggestion of disabling delay scheduling. After this PR, the application will fail with the error message saying not enough resources. ### How was this patch tested? Added a unit test. Closes#29395 from Ngone51/backport-spark-32518. Authored-by: yi.wu <yi.wu@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Make
CoarseGrainedSchedulerBackend.maxNumConcurrentTasks()considers all kinds of resources when calculating the max concurrent tasksRefactor
calculateAvailableSlots()to make it be able to be used for bothCoarseGrainedSchedulerBackendandTaskSchedulerImplWhy are the changes needed?
Currently,
CoarseGrainedSchedulerBackend.maxNumConcurrentTasks()only considers the CPU for the max concurrent tasks. This can cause the application to hang when a barrier stage requires extra custom resources but the cluster doesn't have enough corresponding resources. Because, without the checking for other custom resources inmaxNumConcurrentTasks, the barrier stage can be submitted to theTaskSchedulerImpl. But theTaskSchedulerImplwon't launch tasks for the barrier stage due to the insufficient task slots calculated byTaskSchedulerImpl.calculateAvailableSlots(which does check all kinds of resources).If the barrier stage doesn't launch all the tasks in one true, the application will fail and suggest user to disable delay scheduling. However, this actually a misleading suggestion since the real root cause is not enough resources.
Does this PR introduce any user-facing change?
Yes. In case of a barrier stage requires more custom resources than the cluster has, previously, the application will fail with misleading suggestion of disabling delay scheduling. After this PR, the application will fail with the error message saying not enough resources.
How was this patch tested?
Added a unit test.