-
Notifications
You must be signed in to change notification settings - Fork 595
HDDS-6857. [Snapshot] Implement Snapshot Delete CLI and API #4175
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
Conversation
Change-Id: I06724459fc4e472df952ee2d3255bf9fdf1e3513
…s well for consistency. Change-Id: I6bdb64f992121ef6815eeeb0631e2ba5df142435
Change-Id: I6b1a4a69bec12ccbc2524c4cc7eb3127782902f6
|
@GeorgeJahad @hemanthboyina @aswinshakil Please also take a look. Some of the dead code commented out is intentional in this draft to facilitate discussion. e.g. whether to keep the |
|
With the snapshot delete cli command is it possible to indicate to the user the amount of space that will be freed with the operation? If not here, then through another method. In the example provided, after executing the delete, listing the snapshots (shoiwn above) for the bucket shows the "SNAPSHOT_DELETED" state. With the current example it appears that listing snapshots for the bucket always shows a snapshot in deleted state. We expect it to be removed from the listing at some point? After garbage collection? |
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotDeleteRequest.java
Outdated
Show resolved
Hide resolved
| if (!snapshotInfo.getSnapshotStatus().equals( | ||
| SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE)) { | ||
| // If the snapshot is not in active state, throw exception as well | ||
| throw new OMException("Snapshot exists but no longer active", |
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.
Perhaps "Snapshot pending deletion".
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.
"Snapshot pending deletion" would only apply to SNAPSHOT_DELETED.
I have detailed the snapshot status a bit. Please take another look.
aswinshakil
left a comment
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 for working on this @smengcl. I have some minor comments inline.
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotDeleteRequest.java
Show resolved
Hide resolved
...r/src/test/java/org/apache/hadoop/ozone/om/request/snapshot/TestOMSnapshotDeleteRequest.java
Show resolved
Hide resolved
Hi Neil, we do have snapshot disk usage display planned in HDDS-7744 and has been detailed in the design doc.
It will be cleaned up and removed by |
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotDeleteRequest.java
Show resolved
Hide resolved
Change-Id: I233511813814f78128c2918bd5db18ce16217144
Change-Id: I4ade694b7c4443ac8ea703c7dfa372720a89b98d
prashantpogde
left a comment
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.
LGTM once all the CI tests pass.
Change-Id: Ibf839375697f62f019b3260e3820752fa7a7bf1a
|
Thanks @prashantpogde for the +1. CI passed. I will merge this to unblock other GC work. I've filed HDDS-7862 for the Thanks @hemantk-12 @aswinshakil @neils-dev for the reviews. |
What changes were proposed in this pull request?
ozone sh snapshot delete.OMSnapshotDeleteRequest.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6857
How was this patch tested?
TestOMSnapshotDeleteRequest.TestOMSnapshotDeleteResponse. (Done in HDDS-7862 instead)$ ozone fs -mkdir -p ofs://om/vol1/buck1/dir1/ $ ozone fs -put README.md ofs://om/vol1/buck1/dir1/ $ ozone sh snapshot create /vol1/buck1 snap1 $ ozone sh snapshot delete /vol1/buck1 snap1 $ ozone sh snapshot delete /vol1/buck1 snap1 FILE_NOT_FOUND Snapshot exists but no longer active $ ozone sh snapshot list /vol1/buck1 [ { "volumeName" : "vol1", "bucketName" : "buck1", "name" : "snap1", "creationTime" : 1673583279047, "snapshotStatus" : "SNAPSHOT_DELETED", "snapshotID" : "08f640e3-95db-4596-9d5f-a47cb7272329", "snapshotPath" : "vol1/buck1", "checkpointDir" : "-08f640e3-95db-4596-9d5f-a47cb7272329" } ]