-
Notifications
You must be signed in to change notification settings - Fork 3k
Flink: IcebergFilesCommitter validate dataFile exist start from last committed snapshot. #3103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will be the value of
lastCommittedSnapshotIdif I restore the job from a savepoint?Shouldn't we do something similar for it as we do for
maxCommittedCheckpointIdbut here many things to consider as if we run expire snapshot maintenance procedure before restoring the job from the savepoint(#2482 (comment))Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @ayush-san. As I listed in #2867, restart or restore from checkpoint/savepoint, the
lastCommittedSnapshotIdwill just simply reset to null, androwDeltawill travel all snapshot history to ensure data files still exist and guarantee all snapshot history are valid. If we delete the expired snapshots by maintenance procedure before restoring the job, the validation will travel to the snapshot which is commited by expire snapshot maintenance procedure. I think that whould be ok.This optimization just trying to speed up commit result in runtime, and I want to keep it simple, so I think we don't need to save the
lastCommittedSnapshotIdand restore it from checkpoint/savepoint. but I want to hear @openinx @jackye1995 @stevenzwu @kbendick opinions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Reo-LEI Can you please help me understand how the #2867 help in solving this validation error
I agree with you that we can handle the
lastCommittedSnapshotIdin a separate PR and get this reviewed because this will really speed up the commit time which increases with time. I have seen my flink job checkpoint time increases to 10-15mins from 100-200msUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayush-san I'm very sorry, this is my mistake, I want to link to #3102 (comment), but not #2867 .
And I think this PR will not solving #2482. if the validation error not fixed, this PR will encounter the same problem. I think we should follow #2603 (comment) this to check the exists files to fix the validation error.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but with your PR we can run the snapshot expire task with the flink job running since you are updating the lastCommittedSnapshotId. The only case now left is that when we start the flink job from a checkpoint, we will encounter the same problem.
But if are doing that for one case, we can mimic the same for case when we restore the job from a checkpoint. Anyways we can tackle this in a separate PR and discuss it with @rdblue and @openinx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the snapshot expire task don’t cause the validation error is becasue the
validationHistorywill just travel to thelastCommittedSnapshotand stop valid the removed snapshots which is older than thelastCommittedSnapshot. But once thelastCommittedSnapshotbe removed(e.g. the snapshot expire task run multiple time between two checkpoints) , you will encounter the validation error again.I think store the
lastCommittedSnapshotIdis not a correct way to resolve the validation error(#2482). Because we cann't guarantee thelastCommittedSnapshotwhat we store its snapshot id will alway exists when we restore the flink job. ThelastCommittedSnapshotprobably has been removed when we restore the flink job, and the validation error will raise again. @ayush-san