-
Notifications
You must be signed in to change notification settings - Fork 23
gc: Pass list of paths to fs.remove.
#244
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 all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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.
Just doubt I have, why
.dirfiles have to be removed first?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.
We consider
.dirfiles (and tracked objects inside) to be one single unit. We use this for optimization (assumptions such as if.dirfile exists in the remote, all the directory contents also exist, etc).https://github.com/iterative/dvc-data/blob/e0d19abd5d25525d8d4bc0068c9ac748f3c2aad6/src/dvc_data/hashfile/status.py#L63-L64
We also try to upload all directory contents, and then only if they succeed, we upload
.dirfiles.So ideally here, we should try to delete
.dirfile first, and then all of it's contents in bulk and so on for all objects. Then again do bulk forHashFileobjects.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.
Should we open a separate issue for that?
This P.R. just keeps the previous behavior but benefits from filesystems that implement bulk delete like
gcfsands3fsThere 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.
@daavoo You probably don't want to remove that comment completely.
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.
Should it be better a
# TODO:comment to implement what @skshetry described above?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.
@daavoo, let's just leave it out. It's harder to associate later in practice (Eg: what if there are overlaps between different
.dirfiles, etc.).It is unsafe, but
gcalways is.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.
As long as we remove .dir files before all other files first then gc should be safe. The optimization isn't affected by overlaps between dirs. The only thing we assume when checking remote status is that if a .dir file exists on the remote, then all files inside that .dir exist. It's more unsafe for us to actually attempt to remove .dir+directory contents, then another .dir+directory contents, and so on, because then we do have to get into figuring out directory overlaps.
The existing behavior (and the current state of the PR) should be fine for now.