Conversation
Rename() locates the qtree/LUN's current FlexVol and renames it in place. When newName is a "flexvol/qtree" (or "flexvol/LUN") path -- the format ImportOriginalName uses -- it is treated as an import-failure cleanup revert: after renaming the object back, the FlexVol name is also reverted, but only if that FlexVol still holds exactly one qtree/LUN, since bucket FlexVols are shared and renaming one out from under other qtrees/LUNs would orphan them. If the FlexVol rename fails, the qtree/LUN rename is rolled back to avoid a half-reverted state. Fixes NetApp#1160
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #1160. Implements
Rename()for theontap-nas-economy(qtree) andontap-san-economy(LUN) drivers, which previously returned a hard"rename is not implemented"error.As flagged in the issue discussion,
Rename()for these drivers is used to clean up after a failed volume import, andImportOriginalName(thenewNamepassed in that path) can be a compound"flexvol/qtree"(or"flexvol/LUN") path rather than a plain name, sinceImport()may have renamed both the qtree/LUN and its bucket FlexVol.To handle this safely:
Rename()locates the qtree/LUN's current FlexVol and renames it in place.newNameis a compound"flexvol/qtree"/"flexvol/LUN"path, it's treated as an import-cleanup revert: after renaming the object back, the FlexVol name is also reverted, but only if that FlexVol still holds exactly one qtree/LUN (bucket FlexVols are shared, so renaming one out from under other qtrees/LUNs would orphan them since theirInternalIDpins them to the current FlexVol name).Test plan
go build ./storage_drivers/ontap/...passesgo vet ./storage_drivers/ontap/...passes (pre-existing, unrelated warning only)storage_drivers/ontap/...test suite passes with no regressions