-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-29869][ResourceManager] make ResourceAllocator declarative. #21496
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
|
@xintongsong Could you please help review this PR in your free time? |
04536f0 to
0fff215
Compare
|
@flinkbot run azure |
1941b91 to
9f068d5
Compare
xintongsong
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 opening this PR, @huwh. I have some questions. Please take a look.
.../src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/ResourceDeclaration.java
Outdated
Show resolved
Hide resolved
...ntime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/UnwantedWorker.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManager.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/TaskManagerTracker.java
Outdated
Show resolved
Hide resolved
.../org/apache/flink/runtime/resourcemanager/slotmanager/UnwantedWorkerWithResourceProfile.java
Outdated
Show resolved
Hide resolved
6dfa917 to
b9b572c
Compare
|
Thanks for your comment, @xintongsong, I made the changes
|
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Show resolved
Hide resolved
...me/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/ResourceAllocator.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManager.java
Outdated
Show resolved
Hide resolved
...java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedTaskManagerTracker.java
Outdated
Show resolved
Hide resolved
7af00c3 to
56f3dd1
Compare
|
@xintongsong thanks for the review. problems are addressed. In addition, ARM#requestWorkerIfRequired has been replaced by checkResourceDeclarations at this PR. |
|
I have manually verified these tests below, with DeclarativeSlotManager and DeclarativeSlotManager
|
56f3dd1 to
ba8f480
Compare
xintongsong
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.
@huwh, thanks for addressing the comments. I have squashed the previous fix-up commits to get a complete view of the changes. I think this PR is very close to a mergable state. I have only one concern regarding the semantic change of SlotManager#registerTaskManager, plus a few minor comments.
...me/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/ResourceAllocator.java
Show resolved
Hide resolved
...ime/src/main/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManager.java
Show resolved
Hide resolved
...src/test/java/org/apache/flink/runtime/resourcemanager/active/ActiveResourceManagerTest.java
Outdated
Show resolved
Hide resolved
...test/java/org/apache/flink/runtime/resourcemanager/slotmanager/TestingResourceAllocator.java
Show resolved
Hide resolved
...-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java
Outdated
Show resolved
Hide resolved
| defaultWorkerResourceSpec, totalWorkerNum, new HashSet<>(unWantedWorkers))); | ||
| } | ||
|
|
||
| private void declareNeededResourcesWithDelay() { |
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.
The xxxWithDelay pattern has been repeated 4 times (declarative/fine-grained slot manager, check resource requirement / declare needed resources), and there could be more in future. I wonder if it can be deduplicated as a util. Not necessary for this PR though. This PR is already quite complicated.
…rce to cleaningUpDisconnectedResource.
… to ResourceAllocator.
…lareResourceNeeded to allocate/release resources.
…eDeclarations to check if a new worker needs to be requested when worker fails.
ba8f480 to
bb85fd1
Compare
|
Thanks, @xintongsong, comments are addressed except the XXXWithDely, we can address this in another PR. I force pushed the new commits since it is not easy to avoid conflict while move TestingResourceAllocator.java#declareResourceNeededConsumer to the previous commit. |
xintongsong
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 @huwh. LGTM. Merging this once CI passes.
…eDeclarations to check if a new worker needs to be requested when worker fails. This closes apache#21496
…eDeclarations to check if a new worker needs to be requested when worker fails. This closes apache#21496
What is the purpose of the change
This pull request makes ResourceAllocator declarative in order to reduce the coupling between the SlotManager and the ResourceManager
Brief change log
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation