[POC] HDDS-3915. Simple trash emptier on OM#1181
Closed
smengcl wants to merge 2 commits intoapache:masterfrom
Closed
[POC] HDDS-3915. Simple trash emptier on OM#1181smengcl wants to merge 2 commits intoapache:masterfrom
smengcl wants to merge 2 commits intoapache:masterfrom
Conversation
Change-Id: Ic0b2dfde57078dec310633578a880fd7a7b01568
smengcl
commented
Jul 9, 2020
Removes the extra config to check if acceptance tests are passing.
Member
|
/pending draft PR without activity |
Contributor
Author
|
Closing this PR as this is only a POC and won't be ever merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Implementation something similar to HDFS's
NameNode#startTrashEmptierin OzoneManager to enable automatic trash clean up.Pros:
getTrashRoots()impl.Cons:
Currentcheckpoint.TrashPolicyDefault(specify customfs.trash.classname) on the client & OM: client directly create a timestamp every time it deletes files to trash, eliminating renaming; OM periodically checks for older timestamps and removes them.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3915
How was this patch tested?
Tested manually so far. Steps:
Note on the configs:
fs.defaultFShas to be picked up by OM as it resolves this path to be the FS for trash cleanup thread.fs.trash.intervalis also picked up by OM asfs.trash.checkpoint.intervalin this case.fs.trash.intervalalso needs to be picked up by the client to enable move to trash.Spin up the docker-compose cluster:
Now let's use the client to move a file to trash.
fs.trash.interval=1(1 min for testing purpose) is configured on both OM and client in the container.In a minute OM trash cleanup thread will checkpoint the trash:
2020-07-09 05:34:00,055 [Trash Emptier] INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: ofs://om/volume1/bucket2/.Trash/hadoop 2020-07-09 05:34:00,173 [Trash Emptier] INFO fs.TrashPolicyDefault: Created trash checkpoint: /volume1/bucket2/.Trash/hadoop/200709053400Confirm the checkpoint on the client:
In the next minute the checkpoint is deleted:
2020-07-09 05:35:00,035 [Trash Emptier] INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: ofs://om/volume1/bucket2/.Trash/hadoop 2020-07-09 05:35:00,096 [Trash Emptier] INFO fs.TrashPolicyDefault: Deleted trash checkpoint: /volume1/bucket2/.Trash/hadoop/200709053400