flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-33768] Support dynamic source parallelism inference for batch jobs

Open SinBex opened this issue 1 year ago • 1 comments

What is the purpose of the change

Currently, for JobVertices without parallelism configured, the AdaptiveBatchScheduler dynamically infers the vertex parallelism based on the volume of input data. Specifically, for Source vertices, it uses the value of execution.batch.adaptive.auto-parallelism.default-source-parallelism as the fixed parallelism. If this is not set by the user, the default value of 1 is used as the source parallelism, which is actually a temporary implementation solution.

We aim to support dynamic source parallelism inference for batch jobs

Brief change log

  • Lazily initialize the parallelism of the OperatorCoordinator.
  • Add the DynamicParallelismInference and DynamicFilteringInfo interfaces, and enable the SourceCoordinator to invoke corresponding methods for dynamic parallelism inference.
  • The AdaptiveBatchScheduler applies dynamic source parallelism inference, and to avoid blocking the main thread by calling external systems, we have transformed the scheduling process to be asynchronous.

Verifying this change

This change added tests and can be verified as follows:

  • Added integration tests to verify the end-to-end logic of dynamic parallelism inference, see AdaptiveBatchSchedulerITCase#testSchedulingWithDynamicSourceParallelismInference for details.
  • Added unit tests for the newly added methods in classes such as SourceCoordinator and AdaptiveBatchScheduler.
  • Manually verified the feature on a Flink session cluster (1 JobManager, 77 TaskManagers), including dynamic inference of parallelism, asynchronous scheduling, and execution exceptions in DynamicParallelismInference, all performing as expected.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no )
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs / JavaDocs)

SinBex avatar Jan 12 '24 07:01 SinBex

CI report:

  • 25e8cdee7d24dc7d81caba8dee64cd76409597d7 Azure: FAILURE
  • c05f2291aa6f19c3492562c4e1b7e86af9dbead9 Azure: PENDING
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jan 12 '24 07:01 flinkbot

@flinkbot run azure

SinBex avatar Jan 13 '24 06:01 SinBex

@flinkbot run azure

SinBex avatar Jan 14 '24 12:01 SinBex