onceicy opened a new pull request, #29820: URL: https://github.com/apache/flink/pull/29820
## What is the purpose of the change Fixes [FLINK-41254] (https://issues.apache.org/jira/browse/FLINK-41254). In two-phase event-time window aggregation, a source subtask can become idle while its local operator still holds buffered partial aggregates. Once the idle status reaches the downstream operator, the remaining active inputs can advance the watermark and close the window before those partial aggregates arrive. The resulting window count or sum can be too low. ## Brief change log - Flush buffered partial aggregates in LocalSlicingWindowAggOperator before forwarding WatermarkStatus.IDLE. - Add operator tests for output ordering and SQL integration tests for the resulting window counts and sums. ## Verifying this change - LocalSlicingWindowAggOperatorTest: all 10 cases passed. They cover flush ordering, repeated idle transitions, flush failures, and downstream window results after restore. - WindowAggregateIdleITCase: all 7 cases passed. The tests run TUMBLE, HOP, and CUMULATE with one-phase and two-phase plans, plus a two-phase TUMBLE case with a checkpoint before the idle transition. - Before the fix, all 4 two-phase SQL cases failed and all 3 one-phase controls passed. After the fix, all 7 passed. - Local clean verify completed in stages. 172 of 173 default modules passed a full module verification. In flink-tests, one UnalignedCheckpointRescaleITCase case initially failed with a transport error. All 50 cases in that class passed on rerun, and the remaining compatibility check passed. ## Does this pull request potentially affect one of the following parts: - Dependencies: no - Public API: no - Serializers: no - Runtime per-record code paths: no. The flush is triggered by an idle status event. - Deployment or recovery: no - S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? No. - How is the feature documented? Not applicable. --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes Generated-by: OpenAI Codex (gpt-6-astra) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
