Skip to content

[flink]Newly discovered partition read from earliest rather than scan.startup.mode#3548

Open
loserwang1024 wants to merge 1 commit into
apache:mainfrom
loserwang1024:FLIP-288
Open

[flink]Newly discovered partition read from earliest rather than scan.startup.mode#3548
loserwang1024 wants to merge 1 commit into
apache:mainfrom
loserwang1024:FLIP-288

Conversation

@loserwang1024

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3543

Brief change log

Tests

API and Format

Documentation

@loserwang1024

Copy link
Copy Markdown
Contributor Author


initialDiscoveryFinished = true;
for (SourceSplitBase split : splits) {
unassignedSplits.put(split.getTableBucket(), split);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stores unassigned splits by TableBucket, but TableBucket is not unique for all split types. LakeSnapshotSplit uses splitIndex to distinguish multiple lake splits in the same bucket, so checkpointing only unassignedSplits.values() can drop all but one split (or fail on restore with duplicate keys). Could we persist these by splitId or as a list instead of de-duplicating by TableBucket?

assignedPartitions,
remainingHybridLakeFlussSplits,
leaseId,
false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default is used when restoring old V2 enumerator state, but it leaves initialDiscoveryFinished=false. After an upgrade, partitions created after that old checkpoint can be classified as initial partitions and use the user startup mode (for example latest), which reintroduces the data-loss case this patch is trying to avoid. Could we default old V2 state to true here, or otherwise make the migration preserve post-initial discovery semantics?

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] scan.startup.mode=latest can skip rows written to a new partition before partition discovery

2 participants