Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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".

here (<- link to https://lists.apache.org/list.html?dev@flink.apache.org)
Discussion thread
Vote threadhere (<- link to https://lists.apache.org/list.html?dev@flink.apache.org)
JIRAhere (<- link to https://issues.apache.org/jira/browse/FLINK-XXXX)

JIRA

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyFLINK-15959

ReleaseTBARelease<Flink Version>


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:

  1. Users actually know how many resources are needed when run a single job, initialize all workers when cluster starts can speed up startup process
  2. 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
  3. 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
  4. 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 format

  • The network protocol and api behavior

  • Any class in the public packages under clientsConfiguration, especially client configuration

    • org/apache/kafka/common/serialization

    • org/apache/kafka/common

    • org/apache/kafka/common/errors

    • org/apache/kafka/clients/producer

    • org/apache/kafka/clients/consumer (eventually, once stable)

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

Option nameDefault Value
slotmanager.number-of-slots.min0
slotmanager.min-total-resource.cpuno default value, can be derived from slotmanager.number-of-slots.min
slotmanager.min-total-resource.memoryno 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
languageyml
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.