[FLINK-34559] Limit Global & Local Aggregation buffers
What is the purpose of the change
Limit Global Aggregation buffers
In case of large windows and/or lagging watermarks,
RecordsWindowBuffer processes buffered records and flushes the state
during the sync phase of the checkpoint causing checkpoint timeout.
This change limits the number of records buffered and the buffer size.
Limit Local Aggregation buffers
The buffer holds records for aggregation in memory and is flushed downstream on:
1) checkpoints, 2) watermarks, or 3) when it is full.
If it's too big (even if watermarks are progressing),
there might be much more data to flush than the memory available (classic flatMap problem).
That might lead to back-pressure and hard-blocking the task thread.
This change limits the buffer and the number of records.
Verifying this change
Please make sure both new and modified tests in this PR follow the conventions for tests defined in our code quality guide.
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
- Added integration tests for end-to-end deployment with large payloads (100MB)
- Extended integration test for recovery after master (JobManager) failure
- Added test that validates that TaskInfo is transferred only once across recoveries
- Manually verified the change by running a 4 node cluster with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.
Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no)
- The public API, i.e., is any changed class annotated with
@Public(Evolving): (yes / no) - The serializers: (yes / no / don't know)
- The runtime per-record code paths (performance sensitive): (yes / no / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
- The S3 file system connector: (yes / no / don't know)
Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
CI report:
- afff8794bec09f97eabe4fb90b2bdb9283f52131 Azure: FAILURE
Bot commands
The @flinkbot bot supports the following commands:-
@flinkbot run azurere-run the last Azure build
How about we simply add a set(ConfigOption) and set(String) to ExecutionConfig? It is not really necessary that ExecutionConfig picks up all configuration from ReadableConfig configuration. For a later runtime patching of ExecutionConfig, we could only use the set(String).
We'd still need to call these methods with specific constants or keys, right? And doing so during run time would be problematic (the runtime would need to know these constants).
This PR is being marked as stale since it has not had any activity in the last 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.
If you are having difficulty finding a reviewer, please reach out to the community, contact details can be found here: https://flink.apache.org/what-is-flink/community/
If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.
This PR has been closed since it has not had any activity in 120 days. If you feel like this was a mistake, or you would like to continue working on it, please feel free to re-open the PR and ask for a review.