-
Notifications
You must be signed in to change notification settings - Fork 589
HDDS-7570. Provide a shareable ofs://temp directory #4027
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
…ith admin ALL access and user read+write permissions, subsequently a virtual users tmp directory is form. The virtual tmp directory consists of a tmp bucket under the tmp volume with permissions admin ALL access and user read+write+list. Only the admin can delete the tmp.
…ng configuration ozone-site properties within Ozone Filesystem trash and ofs for shared tmp dir.
…mp path and access control. Admin full access, users r+w only deleting owned files.
|
Thanks @neils-dev for working on this.
Only the admin/owner would be able to move to trash right, I checked hdfs and the behaviour is same or are you proposing to disable the trash selectively for tmp? |
|
Thanks @sadanand48 for looking into this.
The However, leaving the trash service applied to the |
Yes this shouldn't be a problem as the trash emptier is run by the user that starts the OM process so by default it should be an admin so it should be able to issue deletes. However I agree with the idea of disabling trash for the directory as most items in tmp will eventually get deleted after application completes. |
|
@smengcl , @sadanand48, should we update this PR from drafted to a full PR. If there are no significant changes needed, can we update this? |
|
Thanks @neils-dev for the draft PR! I read the description and the overall implementation sounds good to me.
IIRC the current trash deleting service should have been already scanning every single bucket's hidden I'm +1 on marking this ready for review. Note the minor conflict in |
|
@smengcl , following up on quota support for the OZONE-SITE.XML_ozone.om.enable.ofs.shared.tmp.dir=true |
Filed HDDS-7652 for this.
I think there are some bugs in the acl check code path, I was even able to delete a volume and a bucket using a user that was neither admin/owner |
|
Thanks @sadanand48 for looking into the space quota issue with volumes and filing the jira,
I've also filed a jira for looking into supporting only Admin level permissions to set and clear quotas. This is similar to HDFS quotas and the intent of what is documented in the Ozone quota design in What I would like to do is refer to the jiras filed for tracking quota support for the shareable tmp ofs directory. This PR focuses on a patch to provide a shareable tmp ofs directory. If we can, I'd like to prepare to finish this PR to support the shared tmp ofs directory. @smengcl what do think? |
…ields.java conflict.
…, one with missing parameter for updated interface OfsPath, the other a syntax error.
Thanks @smengcl . Please take another look and lets try to complete this PR as is. Separate jiras have been filed for quota issues to support tmp dir quota support. |
...one/integration-test/src/test/java/org/apache/hadoop/ozone/TestOzoneConfigurationFields.java
Outdated
Show resolved
Hide resolved
...one/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OFSPath.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashOzoneFileSystem.java
Outdated
Show resolved
Hide resolved
smengcl
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 @neils-dev for the PR. Looks good to me overall. Just some minor comments inline.
… to ozone-site, defining a constant for the ofs shared tmp bucket name and code cleanup.
|
Thanks @neils-dev for working on this! Thanks @sadanand48 for reviewing this. |
…committing a key (apache#4156) (cherry picked from commit c00d3af) HDDS-7638. Ozone client change to support HSync. (apache#4104) (cherry picked from commit ab91e46) HDDS-7826. Add support for application to probe output stream capability (apache#4205) (cherry picked from commit 2eae7cd) HDDS-7688. Ozone Manager change to support HSync. (apache#4211) (cherry picked from commit a352ab9) client side WIP Change-Id: I5bbc6c75085f68e2395895ca914257411fd6455a (cherry picked from commit d843b0a8374d033f64c6aa2ce99ab5148b2dcf78) WIP Change-Id: I0d6c0d8cc9246d514763abb823aa3af9eb4c3624 (cherry picked from commit 3437e8dd3b4ced673d443219bebd37e4beda0425) Draft. TestOMRecoverLeaseRequest happy path passed. Change-Id: I8b4e5c5baf9e20acbc9481db8fa724b70ac796f2 (cherry picked from commit 147557781a9f6d3c54af155a94bda3816b86d6de) Update version number. Change-Id: I5a961bb9d5fceb8c5f6914cdd50dedd2c43dd1f9 HDDS-7570. Provide a shareable ofs://temp directory (apache#4027) (cherry picked from commit 80f544b) Change-Id: I1168dee51d3e0c048d826b3452ad0f8abbc62015
What changes were proposed in this pull request?
An
ofstmp directory that is common and shared for all users ofofsapplications requiring a temporary directory/tmp. Use cases include applications such as mapreduce and spark that make use of/tmpfrom the filesystem.Providing a common shared
/tmpdirectory forofsallows allows administrators to effectively configure and administer the directory for all users with enforceable access controls and quota policies.Currently, the
ofs://tmpdirectory is a virtual directory configured by the admin but not shareable for all users. Instead each user creates their owntmpdirectory for use withofs. Because of the implementation, eachtmpdirectory can only be administered by the individual users. Administrators currently are unable to access usertmpdirectories. thus administer thetmpdirectories.As with HDDS-2929 a virtual
tmpdirectory is used byofsusers andofsapplications usingofs://tmp. Instead of each user having their owntmpdirectories in the implementation, here a singletmpdirectory is created from thetmpdirectory mount that is shared for all users. Admins have all access and users can read/write files and only delete files owned by the user.The
ofstemp directory is configured with access control as follows:with, ozone.om.enable.ofs.shared.tmp.dir = true in
ozone-site.admin is privileged user
testuser2(admin), regular user istestuser(user) in example with admin configuring ofs tmp directory mount for users:users access the tmp directory as in HDDS-2929,
ozone fs -put ./NOTICE.txt ofs://om/tmpSticky-bit behavior
Configured properly with access control, admin ALL, users R+W+L+C, the common
tmpdirectory behaves like the sticky-bit directory of hdfs, HADOOP-3953 with files intmpdirectory writable by all but files only deleted by owner and admin.Open Questions
Q. What to do with the Trash service on the shared tmp directory, currently executing delete commands with
-skipTrashoption.A. Addressed in the comments,
Only the admin/owner would be able to move to trash
trash service applied to the tmp directory as is operates on delete by placing the owner key in its ofs://tmp/tmp/tmp/.Trash/ path with Acls inherited from the tmp directory and contents.
Q. Need to support quota on tmp directory. This should be able to be applied at either the tmp volume level or tmp bucket level for the virtual ofs://om/tmp path. However, space-quotas appear to not be enforced at the volume level (bug?) and when applied to the bucket level tmp it is enforced but any user that has write permission to the tmp directory can set the quota. For bucket space quotas, only the admin and owner of the bucket should be able to set the quota. Why is it that all users that can access the bucket can set the quota?
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7570
How was this patch tested?
Tested by ofs integration tests, acceptance tests and manually tested with dev secure docker cluster.
Integration test:
TestRootedOzoneFileSystem#testSharedTmpDirAcceptance test:
robot --test "Test tmp mount for shared ofs tmp dir" ozone-secure-fs.robotThe test creates virtual
ofs://tmpdirectory, sets access control and tests putting files intotmpdir with privileged user and regular user. Tests for sticky-bit behavior - all users write, file only deleted by root and owner of file.Manual testing: