-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Core, API: Support cleanupMode in snapshot expiration #14287
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
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fda14eb
[Core,api] Support retainOrphanedDataFiles in snapshot expiration
dramaticlly ddd45ce
Introduce CleanupMode for snapshot expiration
dramaticlly dc0d38d
Rename to CleanupLevel and move as inner class
dramaticlly 4ffe632
Reorder inner enum to be at the top
dramaticlly 96288f0
Added cleanExpiredFiles back and throw better exception
dramaticlly 22ad3ad
Remove id from ExpireSnapshots.CleanupLevel
dramaticlly 61dbd6f
Revert "Remove id from ExpireSnapshots.CleanupLevel"
dramaticlly e27f60c
add explicit early termination
dramaticlly 6f08f99
simplify
dramaticlly bf8f4c1
remove inheritDoc
dramaticlly 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
Some comments aren't visible on the classic Files Changed page.
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
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
Oops, something went wrong.
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.
I feel like this isn't necessary to achieve the behavior of "clean up the metadata files but keep the data/delete files". There's a
deleteWithAPI which allows for custom functions to delete based on paths. A client could just pass in a function which based on if a path is a path in the metadata location clean it up, otherwise don't do anything.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.
Or the passed in logic can be inverted, to skip cleanup if it's in the data location or some other heuristic but I think the point still stands
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 @amogh-jahagirdar ! We actually explored that option and here's what we find
.parquetalone to tell. We can still probably rely on checking$tableLocation/data/as part of file path but this is mostly conventionalThere 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 @dramaticlly , I mostly meant just using the table data location not a suffix as that wouldn't be sufficient but you're right that even the table data location is based on convention.
I agree though that specifying a custom cleanup function isn't the most ideal way to solve this use case.
I think the best argument for this kind of option is reducing costs (reducing unnecessary requests to read manifests, and the compute running when doing so) for cases where we know we only want to cleanup metadata and retain the data file.
The way I look at expressing this kind of logic is a bit different; rather than expressing which files we intend to retain, I look at it as which files should we cleanup. so something like a cleanExpiredFiles(CleanupMode mode)
and the options for CleanupMode like ALL, METADATA_ONLY, NONE. I think on this path we'd deprecate the
cleanExpiredFiles(boolean)option as well, no point keeping both APIs?If we were to go with the current approach we'd have to define precedence if someone uses the existing cleanExpiredFiles and the
retainDataFiles, which is why it seems cleaner to me to define a cleanExpiredFiles API with some modes?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 @amogh-jahagirdar , I think what you proposed makes sense, as today
retainDataFilesneed to have prerequisites ofcleanExpiredFiles=true.But since those are public API on interface, deprecation and removal will need to go through cycles. I can update to use CleanupMode behind the scene.