[Flink] Add configurable initial scan mode for streaming compaction - #9548
Open
lilei1128 wants to merge 6 commits into
Open
[Flink] Add configurable initial scan mode for streaming compaction#9548lilei1128 wants to merge 6 commits into
lilei1128 wants to merge 6 commits into
Conversation
lilei1128
force-pushed
the
fix-compact-snapshot-expire
branch
from
September 3, 2026 08:41
cf95735 to
e009f10
Compare
JingsongLi
reviewed
Sep 3, 2026
| + "dedicated internal streaming scan."); | ||
|
|
||
| public static final ConfigOption<CompactionInitialScanMode> COMPACTION_INITIAL_SCAN_MODE = | ||
| key("compaction.initial-scan-mode") |
Contributor
There was a problem hiding this comment.
it is for ContinuousCompactorStartingScanner, I think the name should be related to continuous.
Contributor
Author
There was a problem hiding this comment.
continuous-compaction.initial-scan-mode is more appropriate name.
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.
Purpose
When a dedicated streaming compaction job starts for a table with existing
snapshots but no COMPACT snapshot, it scans from the earliest available
snapshot to catch up with the historical backlog. For tables with many
snapshots, this catch-up can take a long time, while snapshot expiration may
remove snapshots that are still being scanned. The compaction job can then
fail and repeatedly restart.
Add
compaction.initial-scan-modeto allow the initial compaction scan to usethe latest snapshot as an ALL baseline when historical changelog replay is not
required. The default remains
earliestto preserve existing behavior andchangelog semantics. When a COMPACT snapshot exists, compaction continues from
the snapshot after the latest COMPACT snapshot.
Tests
Add tests covering: