-
Notifications
You must be signed in to change notification settings - Fork 490
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-4307.Start Trash Emptier in Ozone Manager #1507
Conversation
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConfigKeys.java
Outdated
Show resolved
Hide resolved
Can you address the CI failures ? |
...one/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConfigKeys.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashDeletingService.java
Outdated
Show resolved
Hide resolved
Thanks @sadanand48 for the contribution. I've added few comments, please go through it. |
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.
+1, Looks good to me.
Thanks @rakeshadr for the review. Addressed your comments . Will incorporate the changes you suggested on the TrashDeletingService when i include it in the next patch. |
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 @sadanand48 for the contribution. I've added few minor comments.
Apart from these +1 LGTM.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
+1 LGTM |
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 updating the patch. +1, the changes look good to me.
What changes were proposed in this pull request?
The change here is to implement a Trash emptier for Trash Deletion. This feature basically introduces Trash for Ozone File System by leveraging the hadoop code for Trash (
Trash.java
) . When a client does a delete on the filesystem, it calls thefs.rename( src,dst,Options)
api which does a rename to the Trash Path. As an initial approach all operations are on theKeyTable
itself.This pr starts a TrashEmptier and deletes all the files obtained by
fs.getTrashRoots()
. By passing an OFS uri pointing to the root to thisfs
instance covering all volumes and buckets will be ensured. Thus the background service starts the emptier thread which basically iterates through the trash roots and does the checkpointing and then deletion from checkpointed directories.bin/ozone fs -rm o3fs://buck1.vol1/Test2
2020-10-20 18:42:12,779 [main] INFO fs.TrashPolicyDefault: Moved: 'o3fs://buck1.vol1/Test2' to trash at: /.Trash/sadanand.shenoy/Current/Test2
bin/ozone fs -ls -R o3fs://buck1.vol1/
-rw-rw-rw- 1 sadanand.shenoy sadanand.shenoy 0 2020-10-20 18:42 o3fs://buck1.vol1/.Trash/sadanand.shenoy/Current/Test2
after checkpoint interval
-rw-rw-rw- 1 sadanand.shenoy sadanand.shenoy 0 2020-10-20 18:45 o3fs://buck1.vol1/.Trash/sadanand.shenoy/201020184500/Test2
The key gets deleted after the trash interval.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4307
How was this patch tested?
Manually as well as few unit Tests.