-
Notifications
You must be signed in to change notification settings - Fork 175
Delete datastore files iteratively for all datastore types #7441
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
12 commits
Select commit
Hold shift + click to select a range
a5ff572
Revert "Reduce datastore searches during non-vSAN delete operations (…
AngieCris b4f1259
attempt delete datastore folder first; empty it upon failure
AngieCris 15a37bb
fixup! attempt delete datastore folder first; empty it upon failure
AngieCris d7f3d62
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris 3c72908
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris 8045b1a
fixup! fixup! attempt delete datastore folder first; empty it upon fa…
AngieCris 607b60f
fixup! fixup! attempt delete datastore folder first; empty it upon fa…
AngieCris 12b4496
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris a29cd01
trigger drone
AngieCris 25363a0
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris 3ab246e
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris 0b2cedc
Merge branch 'master' of github.com:vmware/vic into vic/7359
AngieCris 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
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.
sorry for the whiplash Angie - given this isn't a direct revert if addressing anchal's comments, could we add a recursive delete attempt as the first thing, then fail over into the current path.
So adding the following at the top:
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.
that's alright. unnecessary recursive delete doesn't sound very neat tbh....
it seems like ESX and older versions of VC don't have the issue but vSAN and new VC version do have that, in most cases it has to go thru iterative delete
if we add
d.deleteVMFSFiles(m, ds, dsPath)at the top, then it would probably print failure log messages complaining not being able to delete non-empty datastore folders. Since we ignore the error coming out of this, and recursively clean stuff up later, if the folder did get cleaned up in the end, looking at the log it would still feel like that there's a failure deleting the folder.sorry about the messy description, but just wondering will it confuse users?
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.
The log looks like this from a test run I did:
The later
Folder "[datastore1] vch-test-4" is not foundis fromvm.Unregsiter, it shows that the folder is already been deletedbut still we see
Failed to delete "[datastore1] vch-test-4/VIC": Cannot delete file [datastore1] vch-test-4/VICon the top, even tho it's actually deleted successfully right after(also we're sort of not supposed to see
Folder "[datastore1] vch-test-4" is not foundfrom unregister at all, but it shows up because the line we added returns NotFound error)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'm okay with them showing up as debug messages - we could add an additional debug message saying "Attempting recursive delete" then if that's not clean a message saying "Cleaning up recusive deletion failures via iterative delete" or similar.
We may want to return a different error type rather than re-use NotFound if it's causing misleading output.
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.
Got it. Here's the log output with the most recent change:
Does this look okay? I added a log saying
Attempt to delete top level folder failed. Remove the children files instead