[flink] Preserve offsets for empty tiering buckets#3505
Open
hutiefang76 wants to merge 1 commit into
Open
Conversation
Assisted-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed
Fixes #3413.
This change keeps lake writes limited to non-empty bucket write results, but collects committed Fluss log offsets and max tiered timestamps from all completed bucket write results in a mixed commit round. That preserves offsets for buckets that only advanced through an empty materialized batch while another bucket produced lake data in the same commit.
The existing empty-write-result test now asserts that the empty bucket offset is included in the committed lake snapshot metadata.
Why
Before this change,
TieringCommitOperatorbuilt thelogEndOffsetsmap from only non-empty write results. In a mixed commit, empty-batch buckets withwriteResult() == nullwere filtered out, so their completed log offsets were not committed even though the commit round had lake data to publish.Tests
TieringCommitOperatorTest#testCommitMeetsEmptyWriteResult; before the production change it failed because bucket 0 offset was missing from the committed snapshot.mvn -s <empty-settings> -pl fluss-flink/fluss-flink-common -am -Dtest=TieringCommitOperatorTest#testCommitMeetsEmptyWriteResult -Dsurefire.failIfNoSpecifiedTests=false testmvn -s <empty-settings> -pl fluss-flink/fluss-flink-common -am -Dtest=TieringCommitOperatorTest -Dsurefire.failIfNoSpecifiedTests=false testgit diff --checkI used an empty temporary Maven settings file locally to avoid a private mirror configured in my user Maven settings.
AI assistance
This PR was prepared with assistance from OpenAI Codex. I reviewed the change and verified the tests above.