Skip to content

[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport 2.0)#27574

Open
nateab wants to merge 1 commit intoapache:release-2.0from
nateab:FLINK-35661-backport-2.0
Open

[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport 2.0)#27574
nateab wants to merge 1 commit intoapache:release-2.0from
nateab:FLINK-35661-backport-2.0

Conversation

@nateab
Copy link
Contributor

@nateab nateab commented Feb 10, 2026

What is the purpose of the change

Backport of #27505 to release-2.0.

This fixes a bug in MiniBatchGroupAggFunction.finishBundle() where records were being silently dropped when a mini-batch bundle contained a key with only retraction messages and no existing accumulator state.

The root cause was using return instead of continue when inputRows became empty after filtering out leading retraction messages for a key with no state. This caused the method to exit entirely, abandoning processing of all remaining keys in the bundle.

Brief change log

  • Changed return; to continue; in MiniBatchGroupAggFunction.finishBundle() so processing continues to the next key instead of exiting the entire method
  • Added unit test MiniBatchGroupAggFunctionTest that directly verifies the fix

Verifying this change

This change added tests and can be verified as follows:

  • Added MiniBatchGroupAggFunctionTest.testFinishBundleContinuesAfterEmptyInputRows() which creates a mock bundle with three keys where the first key has only a DELETE message (no existing state). The test verifies that keys after the first are still processed correctly.

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 10, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@rionmonster
Copy link
Contributor

@flinkbot run azure

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Feb 11, 2026
@pnowojski
Copy link
Contributor

@nateab , ditto please check the CI failures if they are related to your changes.

@nateab
Copy link
Contributor Author

nateab commented Feb 11, 2026

flaky failure that just got fixed recently, let me rebase and push https://issues.apache.org/jira/browse/FLINK-39052

…records

When finishBundle() encounters a key with only retraction messages and no
existing state, it now uses 'continue' instead of 'return' to skip that key
and continue processing remaining keys in the bundle.

This change adds a unit test using KeyedOneInputStreamOperatorTestHarness
with KeyedMapBundleOperator to verify the fix.
@nateab nateab force-pushed the FLINK-35661-backport-2.0 branch from 63ae110 to 7481e6c Compare February 11, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community. target:release-2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants