[FLINK-33768] Support dynamic source parallelism inference for batch jobs
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
DynamicParallelismInferenceandDynamicFilteringInfointerfaces, and enable theSourceCoordinatorto invoke corresponding methods for dynamic parallelism inference. - The
AdaptiveBatchSchedulerapplies 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#testSchedulingWithDynamicSourceParallelismInferencefor details. - Added unit tests for the newly added methods in classes such as
SourceCoordinatorandAdaptiveBatchScheduler. - 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)
CI report:
- 25e8cdee7d24dc7d81caba8dee64cd76409597d7 Azure: FAILURE
- c05f2291aa6f19c3492562c4e1b7e86af9dbead9 Azure: PENDING
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
@flinkbot run azure
@flinkbot run azure