-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-20079][yarn] Fix client AM not allocating executors after restart. #18663
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
…tart. The main goal of this change is to avoid the situation described in the bug, where an AM restart in the middle of a job may cause no new executors to be allocated because of faulty logic in the reset path. The change does two things: - fixes the executor alloc manager's reset() so that it does not stop allocation after a reset() in the middle of a job - re-orders the initialization of the YarnAllocator class so that it fetches the current executor ID before triggering the reset() above. This ensures both that the new allocator gets new requests for executors, and that it starts from the correct executor id. Tested with unit tests and by manually causing AM restarts while running jobs using spark-shell in YARN mode.
|
FYI, I started by trying to clean up the referenced PR but ended up pretty much re-writing it... |
|
Test build #79692 has finished for PR 18663 at commit
|
| // a new one registered after the failure. This will only happen in yarn-client mode. | ||
| reset() | ||
| } | ||
| reset() |
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.
Is it OK to trigger reset even in the first attempt?
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.
Yes. There are no executors when the first attempt registers with the driver, so everything reset() does basically amounts to a no-op.
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.
Thanks for the explain, let me try your patch locally.
|
LGTM, I tried it locally, looks now executors can be ramped up soon after AM restart. |
|
I haven't had a chance to look at this yet, but this doesn't by chance fix the allocator re-evaluating if it needs executors all the time does it? I have seen issues where executors can idle timeout, because scheduler isn't scheduling them fast enough, might be busy or the locality wait settings interfere. it gets down to only a few executors even though it has 10000+ tasks to run still. If it doesn't I will file a separate jira for that. I'll try to review this later today |
|
That sounds like a different issue. I've seen @squito debugging issues that sound similar to that, not sure if he got down to making any scheduler changes. |
|
Test build #79940 has finished for PR 18663 at commit
|
|
retest this please |
|
Test build #80085 has finished for PR 18663 at commit
|
|
Merging to master. |
The main goal of this change is to avoid the situation described
in the bug, where an AM restart in the middle of a job may cause
no new executors to be allocated because of faulty logic in the
reset path.
The change does two things:
stop allocation after a reset() in the middle of a job
it fetches the current executor ID before triggering the reset()
above.
This ensures both that the new allocator gets new requests for executors,
and that it starts from the correct executor id.
Tested with unit tests and by manually causing AM restarts while
running jobs using spark-shell in YARN mode.
Closes #17882