You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »


Document the state by adding a label to the FLIP page with one of "discussion", "accepted", "released", "rejected".

Discussion thread
Vote thread
JIRA

Unable to render Jira issues macro, execution error.

ReleaseTBA

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

As described in FLINK-15959, 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:

  1. Users actually know how many resources are needed when running a single job, initialize all workers when cluster starts can speed up startup process

  2. Job schedule in topology order, the next operator won't schedule until prior execution slot allocated. The TaskExecutors will start in several batches . In some cases, it might slow down the startup speed

  3. Flink supports FLINK-12122 [Spread out tasks evenly across all available registered TaskManagers], but it will only effect if all TMs are registered. Starting all TMs at the beginning can solve this problem

  4. For session clusters running short lived-jobs, clusters should have workers all the time to reduce job's E2E latency


Public Interfaces

Option nameDefault Value
slotmanager.number-of-slots.min0
slotmanager.min-total-resource.cpuno default value, it can be derived from slotmanager.number-of-slots.min
slotmanager.min-total-resource.memoryno default value, it 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 needs 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 are introduced, users can configure both minimum and maximum required resources in SlotManager, which might lead to worker resource oscillation. Here is an example:

taskmanager.numberOfTaskSlots: 5
slotmanager.number-of-slots.min: 11
slotmanager.number-of-slots.max: 14

In this case, the minimum required worker number derived from DefaultResourceAllocationStrategy is 3 but this will exceed the max total resource limit, which is 14 slots.

To avoid this oscillation, we need to check the worker number derived from minimum and maximum resource configuration is consistent before starting SlotManager.


Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?  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.

  • No labels