This page is meant as a template for writing a FLIP. To create a FLIP choose Tools->Copy on this page and modify with your content and replace the heading with the next FLIP number and a description of your issue. Replace anything in italics with your own description.
Page properties | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Document the state by adding a label to the FLIP page with one of "discussion", "accepted", "released", "rejected".
|
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Describe the problems you are trying to solve.
Public Interfaces
...
Currently, ResourceManager will only start a a new worker when there's resource requirements from job. But in certain scenarios, it is necessary to maintain a certain amount of slots as soon as ResourceManager is started. And these slots should not release even if all slots are free. Here are some scenarios which can benefit from this proposal:
- Users actually know how many resources are needed when run a single job, initialize all workers when cluster starts can speed up startup process
- Job schedule in topology order, next operator won't schedule until prior execution slot allocated. The TaskExecutors will start in several batchs in some cases, it might slow down the startup speed
- Flink support FLINK-12122 [Spread out tasks evenly across all available registered TaskManagers], but it will only effect if all TMs are registered. Start all TMs at begining can slove this problem
- For session clusters running short lived-jobs, cluster should have workers all the time to reduce job's E2E latency
Public Interfaces
A public interface is any change to the following:
Binary log formatThe network protocol and api behaviorAny class in the public packages under clientsConfiguration, especially client configurationorg/apache/kafka/common/serializationorg/apache/kafka/commonorg/apache/kafka/common/errorsorg/apache/kafka/clients/producerorg/apache/kafka/clients/consumer (eventually, once stable)
MonitoringCommand line tools and argumentsAnything else that will likely break existing users in some way when they upgrade
Proposed Changes
Option name | Default Value |
---|---|
slotmanager.number-of-slots.min | 0 |
slotmanager.min-total-resource.cpu | no default value, can be derived from slotmanager.number-of-slots.min |
slotmanager.min-total-resource.memory | no default value, can be derived from slotmanager.number-of-slots.min |
Proposed Changes
Minimum required resource check in DefaultResourceAllocationStrategy
The minimum resource allocation will be implemented in the DefaultResourceAllocationStrategy of FineGrainedSlotManager.
Each time when SlotManager need to reconcile the cluster resources or fulfill job resource requirements, the DefaultResourceAllocationStrategy will check if the minimum resource requirement has been fulfilled. If it is not, DefaultResourceAllocationStrategy will add PendingTaskManagers to the ResourceAllocationResult/ResourceReconcileResult and FineGrainedSlotManager will allocate new worker resources accordingly.
Resource stability check in SlotManagerConfiguration
After minimum required resource options is introduced, user can configure both minimum and maximum required resource in SlotManager which might lead to worker resource oscillation. Here is an example:
Code Block | ||
---|---|---|
| ||
taskmanager.numberOfTaskSlots: 5
slotmanager.number-of-slots.min: 11
slotmanager.number-of-slots.max: 14 |
In this case, the min required worker number derived from DefaultResourceAllocationStrategy is 3 but this will exceed the max total resource.
To Avoid this oscillation, we need to check the worker number derived from minimum and maximum resource configuration is consistent before starting the SlotManagerDescribe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
- If we are changing behavior how will we phase out the older behavior?
- If we need special migration tools, describe them here.
- When will we remove the existing behavior?
Test Plan
...
- No
Test Plan
UT & Manually verify that the min resource allocation is working as expected.
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.