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-4307.Start Trash Emptier in Ozone Manager #1507

Merged
merged 11 commits into from
Nov 11, 2020

Conversation

sadanand48
Copy link
Contributor

@sadanand48 sadanand48 commented Oct 20, 2020

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 the fs.rename( src,dst,Options) api which does a rename to the Trash Path. As an initial approach all operations are on the KeyTable 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 this fs 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.

@cxorm cxorm self-requested a review October 20, 2020 14:50
@prashantpogde
Copy link
Contributor

Can you address the CI failures ?

@rakeshadr
Copy link
Contributor

Thanks @sadanand48 for the contribution. I've added few comments, please go through it.

@sadanand48 sadanand48 changed the title HDDS-4307.Start Background Service for Trash Deletion in Ozone Manager HDDS-4307.Start Trash Emptier in Ozone Manager Oct 23, 2020
Copy link
Contributor

@mukul1987 mukul1987 left a 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.

@sadanand48
Copy link
Contributor Author

sadanand48 commented Oct 27, 2020

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.

Copy link
Contributor

@rakeshadr rakeshadr left a 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.

@prashantpogde
Copy link
Contributor

+1 LGTM

Copy link
Contributor

@mukul1987 mukul1987 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 updating the patch. +1, the changes look good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants