Skip to content
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

HDDS-5901. Delete on volume/bucket throws fatal error on ofs #2776

Merged
merged 1 commit into from Oct 28, 2021

Conversation

siddhantsangwan
Copy link
Contributor

@siddhantsangwan siddhantsangwan commented Oct 27, 2021

What changes were proposed in this pull request?

Recursive delete ozone fs -rm -R ofs://ozone1/absdf
on a volume or bucket gives the following fatal error as no trash is configured at root level.

-rm: Fatal internal error
java.lang.RuntimeException: Volume or bucket doesn't have trash root.
at org.apache.hadoop.ozone.OFSPath.getTrashRoot(OFSPath.java:298)
at org.apache.hadoop.fs.ozone.BasicRootedOzoneFileSystem.getTrashRoot(BasicRootedOzoneFileSystem.java:727)
at org.apache.hadoop.fs.TrashPolicyDefault.moveToTrash(TrashPolicyDefault.java:134)
at org.apache.hadoop.fs.Trash.moveToTrash(Trash.java:110)
at org.apache.hadoop.fs.Trash.moveToAppropriateTrash(Trash.java:96)
at org.apache.hadoop.fs.shell.Delete$Rm.moveToTrash(Delete.java:153)
at org.apache.hadoop.fs.shell.Delete$Rm.processPath(Delete.java:118)
at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367)
at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331)
at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304)
at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286)
at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270)
at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120)
at org.apache.hadoop.fs.shell.Command.run(Command.java:177)
at org.apache.hadoop.fs.FsShell.run(FsShell.java:328)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
at org.apache.hadoop.fs.ozone.OzoneFsShell.main(OzoneFsShell.java:81)

This patch changes the Fatal error message:

Volume or bucket doesn't have trash root.

to something a bit more user friendly:

Recursive rm of volume or bucket with trash enabled is not permitted. Consider using the -skipTrash option.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5901#

How was this patch tested?

Manual testing using Docker compose.

image

@siddhantsangwan
Copy link
Contributor Author

@sadanand48 Please take a look.

Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch @siddhantsangwan . +1 LGTM

@mukul1987 mukul1987 merged commit a5d6707 into apache:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants