-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-9731] Standalone scheduling incorrect cores if spark.executor.cores is not set #8017
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
Conversation
|
@andrewor14 , would you mind taking a look at this? This is related to recently changes in #7274 and #7668 |
|
Test build #40130 has finished for PR 8017 at commit
|
|
retest this please |
|
You guys probably understand this better than I, but I don't immediately see why this would change the behavior described in the JIRA. It allows executor scheduling where it didn't before (in the case where no executors are being launched though?) but why does that make more cores get assigned to the executor that's launched? I also couldn't see where the available memory was set to 4g. |
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.
I guess this is not affected because minCoresPerExecutor is 1 in this case.
|
retest this please. I'm upgrading this to a 1.5 blocker. |
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.
would you mind rewriting this as follows now that we have more shared code?
val keepScheduling = coresToAssign >= minCoresPerExecutor
val enoughCores = usableWorkers(pos).coresFree - assignedCores(pos) >= minCoresPerExecutor
// If we allow multiple executors per worker, then we can always launch new executors.
// Otherwise, if there is already an executor on this worker, just give it more cores.
val launchingNewExecutor = !oneExecutorPerWorker || assignedExecutors(pos) == 0
if (launchingNewExecutor) {
val assignedMemory = assignedExecutors(pos) * memoryPerExecutor
val enoughMemory = usableWorkers(pos).memoryFree - assignedMemory >= memoryPerExecutor
val underLimit = assignedExecutors.sum + app.executors.size < app.executorLimit
keepScheduling && enoughCores && enoughMemory && underLimit
} else {
// We're adding cores to an existing executor, so no need to check memory and executor limits
keepScheduling && enoughCores
}
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.
Looks great. I'll update it.
|
Test build #40178 has finished for PR 8017 at commit
|
|
Test build #40219 has finished for PR 8017 at commit
|
|
retest this please. |
|
Test build #40220 has finished for PR 8017 at commit
|
|
LGTM, merging into master and 1.5. Thanks for your fix. |
…cores is not set The issue only happens if `spark.executor.cores` is not set and executor memory is set to a high value. For example, if we have a worker with 4G and 10 cores and we set `spark.executor.memory` to 3G, then only 1 core is assigned to the executor. The correct number should be 10 cores. I've added a unit test to illustrate the issue. Author: Carson Wang <[email protected]> Closes #8017 from carsonwang/SPARK-9731 and squashes the following commits: d09ec48 [Carson Wang] Fix code style 86b651f [Carson Wang] Simplify the code 943cc4c [Carson Wang] fix scheduling correct cores to executors (cherry picked from commit ef062c1) Signed-off-by: Andrew Or <[email protected]>
…cores is not set The issue only happens if `spark.executor.cores` is not set and executor memory is set to a high value. For example, if we have a worker with 4G and 10 cores and we set `spark.executor.memory` to 3G, then only 1 core is assigned to the executor. The correct number should be 10 cores. I've added a unit test to illustrate the issue. Author: Carson Wang <[email protected]> Closes apache#8017 from carsonwang/SPARK-9731 and squashes the following commits: d09ec48 [Carson Wang] Fix code style 86b651f [Carson Wang] Simplify the code 943cc4c [Carson Wang] fix scheduling correct cores to executors
The issue only happens if
spark.executor.coresis not set and executor memory is set to a high value.For example, if we have a worker with 4G and 10 cores and we set
spark.executor.memoryto 3G, then only 1 core is assigned to the executor. The correct number should be 10 cores.I've added a unit test to illustrate the issue.