Skip to content

[flink] Fix batch log scan with empty buckets - #4007

Open
Gezi-lzq wants to merge 2 commits into
apache:mainfrom
Gezi-lzq:codex/fluss-3972-fix
Open

[flink] Fix batch log scan with empty buckets#4007
Gezi-lzq wants to merge 2 commits into
apache:mainfrom
Gezi-lzq:codex/fluss-3972-fix

Conversation

@Gezi-lzq

Copy link
Copy Markdown

Purpose

Linked issue: close #3972

When a Flink batch job scans a multi-bucket Fluss Log Table with low parallelism, an empty bucket can remain active after its bounded split has finished. Subsequent fetch results may then contain a split ID that Flink has already unregistered.

This change ensures that bounded log splits are completed based on scanner progress and that finished buckets are retired before the next fetch.

Brief change log

  • Complete bounded log splits when consumedUpToOffset reaches the stopping offset.
  • Handle empty bounded splits starting from EARLIEST_OFFSET.
  • Remove finished buckets from the Flink source reader mapping and unsubscribe them from the log scanner.
  • Add regression coverage for empty buckets and empty bounded splits.

Tests

  • FlinkSourceSplitReaderTest
  • Flink120TableSourceBatchITCase
  • ./mvnw -pl fluss-flink/fluss-flink-common -DskipTests verify

API and Format

No API or storage format changes.

Documentation

No documentation changes.

Generative AI Disclosure

  • Yes — OpenAI Codex

Use scanner progress to finish bounded log splits when filtering materializes no records. Add a batch regression test for statistics-filtered log tables.

Fixes apache#3872
@Gezi-lzq

Copy link
Copy Markdown
Author

Hi @loserwang1024 and @wuchong, when you have time, could you please help review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flink] Batch Log Table scan fails when some buckets are empty

1 participant