-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-8778. Support recursive volume delete using Ozone sh command. #4842
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
|
@sadanand48 @sumitagrawl , Please help to review. |
sadanand48
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 @ashishkumar50 for the patch, left few comments.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Outdated
Show resolved
Hide resolved
|
@ashishkumar50 Could you include what the CLI would look like in the PR description? What subcommand is used, what flags are supported, is there a confirmation prompt, can it be overridden, etc. These UX aspects are probably what people would have the most comments on. |
@errose28, Update PR description with all options. |
|
Why is there a -skipTrash option? It seems the same as -r and o3 has no concept of trash. |
We do support trash using o3 for FSO bucket. |
| private boolean bSkipTrash = false; | ||
| @CommandLine.Option( | ||
| names = {"-r"}, | ||
| description = "Delete volume recursively" |
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 add in description similar to Ozonefsdelete description->"Delay is " +
"expected when walking over large directory recursively to count".
Also Ozonefsdelete has some params used for limit hadoop.shell.delete.limit.num.files along with Safely confimration, will that be useful here as well?
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.
Added in the interactive description when user does recursive delete. About limit number we can have improvement in future for this command. In PR description I have added how the interactive description looks like.
|
If the command always fails if --skipTrash is not provided then that argument is redundant. I think the confirmation message should specify that there is no trash recovery for FSO buckets when this command is used, then -y or user input becomes the manual override required. Also I don't think the recently added Incorporating these two suggestions together provides a consistent experience across the two commands without redundant arguments implying that trash exists where it does not. |
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Show resolved
Hide resolved
Removed -skipTrash option, instead showing in interactive description. Updated the change in PR description. |
I think the override should be a separate flag, not an argument to -r. When in doubt, look at existing CLIs for the intuitive thing to do.
This should probably also specify that there is no recovery option for OBS buckets either, although we don't have that anyways. Maybe a message like "There is no recovery option after using this command, and no trash for FSO buckets" would help. Also, is there a follow up PR to implement recursive bucket delete as well? |
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/DeleteVolumeHandler.java
Outdated
Show resolved
Hide resolved
I have updated with separate flag to override. |
|
CLI options LGTM although I will not have time to review the code changes. Thanks for updating those @ashishkumar50 |
|
Thanks @ashishkumar50 for addressing the comments. The changes look good to me. We should also document the newly made changes regarding ozone sh deletes to get clarity on items like trash. Opened HDDS-8916 for the same. |
Okay @sadanand48, I will document these new changes in HDDS-8916 |
* master: (79 commits) HDDS-8914. Datanode may fail to start due to duplicate VolumeInfoMetrics (apache#4966) HDDS-8921. Add support for EC in Freon SCM block generator (apache#4982) HDDS-8927. Metadata scanner should not scan unhealthy containers. (apache#4976) HDDS-8929. Avoid list allocation for pipeline search (apache#4980) HDDS-8778. Support recursive volume delete using Ozone sh command. (apache#4842) HDDS-8885. Quota repair count enable quota feature for old bucket/volume. (apache#4941) HDDS-8771. Refactor volume level tmp directory for generic usage. (apache#4838) HDDS-8922. Random EC read pipeline ID causes XceiverClient cache churn (apache#4971) HDDS-8586 Recon. - API for Count of deletePending keys and amount of data mapped to such keys. (apache#4923) HDDS-8908. Intermittent failure in TestBlockDeletion#testBlockDeletion (apache#4958) HDDS-8910. Replace LockManager with striped lock in ContainerStateManager (apache#4962) HDDS-8917. Move protobuf conversion out of the lock in PipelineStateManagerImpl (apache#4965) HDDS-8825. Use apache/hadoop 3.3.5 docker image (apache#4963) HDDS-8906. Avoid stream when getting in-service healthy nodes (apache#4960) HDDS-8907. Store volume count when storage report is updated (apache#4957) HDDS-8905. PipelineManager metrics should not be synchronized (apache#4959) HDDS-8553. Improve scanner integration tests. (apache#4936) HDDS-8854. Avoid unnecessary DatanodeDetails creation for NodeStateManager lookup (apache#4925) HDDS-8315. [Snapshot] Added unit tests for SnapshotDiffManager (apache#4716) HDDS-7968. [Snapshot] Improve KeyDeletingService to reclaim eligible key blocks in snapshot's deletedTable (apache#4935) ...
* master: HDDS-8914. Datanode may fail to start due to duplicate VolumeInfoMetrics (apache#4966) HDDS-8921. Add support for EC in Freon SCM block generator (apache#4982) HDDS-8927. Metadata scanner should not scan unhealthy containers. (apache#4976) HDDS-8929. Avoid list allocation for pipeline search (apache#4980) HDDS-8778. Support recursive volume delete using Ozone sh command. (apache#4842) HDDS-8885. Quota repair count enable quota feature for old bucket/volume. (apache#4941) HDDS-8771. Refactor volume level tmp directory for generic usage. (apache#4838) HDDS-8922. Random EC read pipeline ID causes XceiverClient cache churn (apache#4971)
What changes were proposed in this pull request?
Currently recursive volume delete is supported only using fs command. But fs can be used only for FSO and Legacy bucket. Since volume can contain mix bucket types and if volume contains some OBS bucket in it then fs rm command fails in between. Currently there is no way for user to delete volume in easy way.
In this PR, As sh can be used for all bucket types, using ozone sh command user can now perform volume delete recursively.
Description about new the command:
Create Volume: vol1 and few buckets/keys inside it.
Apart from these options we can also provide number of threads(-t "no of threads") for deletion.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8778
How was this patch tested?
Added new integration test and verified.