-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-18226][runtime] Fix ActiveResourceManager requesting extra workers on termination of existing workers. #12620
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
[FLINK-18226][runtime] Fix ActiveResourceManager requesting extra workers on termination of existing workers. #12620
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 4123e5f (Fri Jun 12 02:21:00 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
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 creating this PR @xintongsong. The changes look good to me. I had some minor comments.
I have to admit that the changes are not super easy to follow with all the different callbacks and the special semantics of allocatedNotRegisteredWorkerResourceSpecs for notifyAllocatedWorkerRegistered and notifyAllocatedWorkerStopped now.
I believe this underlines the need for properly refactoring the ActiveResourceManager. Otherwise I fear that it will become quite unwieldy in the foreseeable future.
...k-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerGateway.java
Outdated
Show resolved
Hide resolved
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/KubernetesResourceManagerTest.java
Outdated
Show resolved
Hide resolved
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/KubernetesResourceManagerTest.java
Show resolved
Hide resolved
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/KubernetesResourceManagerTest.java
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java
Outdated
Show resolved
Hide resolved
|
Thanks for the review, @tillrohrmann. BTW. The revert commit is added to clearly show what have been changed since your last review. I'll remove it together with the original renaming commit at merging, if you're good with the changes. |
tillrohrmann
left a comment
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 addressing my comments @xintongsong. I had a single comment left which is relevant for calling onTaskManagerRegistration. Please take a look.
| if (workerTypeWorkerRegistration.getInstanceID().equals(taskManagerRegistrationId)) { | ||
| registerTaskManagerAtSlotManager(workerTypeWorkerRegistration, slotReport); | ||
| slotManager.registerTaskManager(workerTypeWorkerRegistration, slotReport); | ||
| onTaskManagerRegistration(workerTypeWorkerRegistration); |
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 think we might call onTaskManagerRegistration multiple times if the TM decides to call sendSlotReport repeatedly.
…s on termination of existing workers. ActiveResourceManager decides whether and how many new wokers to request based on the following equation. workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotRegistered where previsoutly 'workersRequestedByResourceManagerNotRegistered' was 'workersRequestedByResourceManagerNotAllocated'.
… workers on termination of existing workers.
ebbf877 to
3da8881
Compare
|
Thanks @tillrohrmann, your last comment makes sense to me.
|
tillrohrmann
left a comment
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 updating the PR @xintongsong. LGTM. +1 for merging.
…s on termination of existing workers. ActiveResourceManager decides whether and how many new wokers to request based on the following equation. workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotRegistered where previsoutly 'workersRequestedByResourceManagerNotRegistered' was 'workersRequestedByResourceManagerNotAllocated'. This closes #12620.
…s on termination of existing workers. ActiveResourceManager decides whether and how many new wokers to request based on the following equation. workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotRegistered where previsoutly 'workersRequestedByResourceManagerNotRegistered' was 'workersRequestedByResourceManagerNotAllocated'. This closes apache#12620.
…s on termination of existing workers. ActiveResourceManager decides whether and how many new wokers to request based on the following equation. workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotRegistered where previsoutly 'workersRequestedByResourceManagerNotRegistered' was 'workersRequestedByResourceManagerNotAllocated'. This closes apache#12620.
What is the purpose of the change
This PR fixes the problem that
ActiveResourceManagermay request unnecessary extra workers on termination of existing workers.Brief change log
The equation previously used by
ActiveResourceManagerfor deciding whether and how many new workers to request on termination of existing workers is:workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotAllocatedIf there are workers allocated, being started but not yet registered, unnecessary new workers will be requested.
Now the equation is changed to:
workersToRequest = workersRequiredBySlotManager - workersRequestedByResourceManagerNotRegisteredVerifying this change
New test cases added in
KubernetesResourceManagerTestandYarnResourceManagerTest.Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation