-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6134] Prevent two clean run concurrently in flink #8568
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
Merged
danny0405
merged 1 commit into
apache:master
from
hbgstc123:HUDI-6134_prevent_clean_run_concurrently_in_flink
May 16, 2023
Merged
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
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's the matter if there are multiple cleaning tasks runing here?
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.
Multiple cleaning tasks maybe running the same clean instant, it's unnecessary.
And now multi clean can leave
.hoodie/20230425173418352.clean.tmpthis tmp file in timeline because the slower clean task will fail to rename this tmp file to the final20230425173418352.cleanbecause it will be there created by an earlier clean task.We can try fix the rename issue in
HoodieActiveTimeline.transitionStatetoo, delete the tmp file when rename is unsuccessful.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.
That's not possible, cleaning service may have clean plan, one file can only belongs to one cleaning plan.
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.
First I see the clean.tmp file in a flink write hudi job with online compaction,
recently I see the clean tmp file in timeline again in a flink job with offline compaction.
I write an issue about it:
#8726
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.
Can you explain why the same cleaning instant is executed by multiple tasks? You mean the cleaning service would try to execute the existing pending cleaning instant? Can you show us the code there?
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.
After some analysis I find that there is an option
hoodie.clean.allow.multiplefor multiple writer cleaning, and by default it is true.I also find that the clean action executor would try to clean all the pending cleaning instants on the timeline if
hoodie.clean.allow.multipleis enabled.But in flink streaming, the cleaning is scheduled and executed in a single worker thread pool, that means at most 1 cleaning task is running for streaming pipeline.
But there is possibility for batch ingestion job, the
#openmethod and#doCommitmethod can trigger the cleaning in separeate threads. Is that your case here?