-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-8653. Let directory inherit parent default ACLs #4738
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
adoroszlai
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 @whbing for reporting the problem and working on it.
TestRecursiveAclWithFSO is failing, please check.
Please also add tests to verify the new behavior.
...r/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequestWithFSO.java
Outdated
Show resolved
Hide resolved
...-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequest.java
Outdated
Show resolved
Hide resolved
...-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequest.java
Outdated
Show resolved
Hide resolved
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
adoroszlai
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 @whbing for updating the patch.
...r/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequestWithFSO.java
Outdated
Show resolved
Hide resolved
...ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java
Show resolved
Hide resolved
|
I started a disscuss in #4752. Will update commit after disscussing. |
|
Currently implemented logic: The logic of acl inheritance is as follows
The benefits of the above changes are:
|
|
ci passed in : https://github.com/whbing/ozone/actions/runs/5172606799 |
|
@ChenSammi @fapifta please review |
sumitagrawl
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.
@whbing Thanks for working for this, having few comments.
IMO,
- getting inheritDefaultAcl can be done at place where creating Directory, instead of passing filtered defaultAcl, similar to OmKeyRequest.getAclsForKey used in FileInfo create
- This flow is for creating missing parent directory.
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.
filterDefaultScope is not done for omBucketInfo.getAcls() present at line no 197, so if no parent dir, only bucket, then will take all acls from bucket
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.
IMO, instead of changing PathInfo, it can filter Default at time of Directory / file creation. FileInfo creation, its handled. But directory creation for all flow, this needs handle.
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.
method itself will inherit only default acl, it seems no need set again toDefaultScope() and this method may not be useful
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.
method itself will inherit only default acl, it seems no need set again toDefaultScope() and this method may not be useful
@sumitagrawl The current convention is ACLs which the directory inherits necessary to keep DEFAULT scope, except leaf file. I added toDefaultScope without changing the basis inheritDefaultAcls method. How do you think about it? Thanks.
...n/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequest.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java
Outdated
Show resolved
Hide resolved
|
@sumitagrawl Thanks for review ! I will try to make some optimizations based on your comments, and then reply to you. |
454248c to
c276ffb
Compare
|
ci passed in: https://github.com/whbing/ozone/actions/runs/5291548464 |
sumitagrawl
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.
@whbing Thanks for fixing the previous comments, few new comments are there, please handle.
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequest.java
Outdated
Show resolved
Hide resolved
...org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequestWithFSO.java
Outdated
Show resolved
Hide resolved
@whbing , it's good to have a summary here. I have one question about "LEGACY" bucket. Say there are two subdirs under bucket1, one is dir1/, another is dir1/dir2/. Bucket has one DEFAULT ACL1, dir1/ has one DEFAULT ACL2(prefix ACL), will dir1/dir2/ inherits both ACL1 and ACL2? |
I think it is:
In normal cases, inheritance starts with the DEFAULT of the bucket. If the middle dir is changed, the sub-node should only follow the behavior of the latest parent dir. I guess so. How about that logic? |
|
ci passed in my branch with last commit: https://github.com/whbing/ozone/actions/runs/5532904297 |
sumitagrawl
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.
@whbing Thanks for working over this, LGTM+1
By the way, I can add this logic to |
|
@sumitagrawl @ChenSammi The documentation was supplemented based on the previous commit. Other code logic has not changed. If you have time, PTAK, thanks ! |
|
Ci passed in branch. please help triger ci, thanks. @ChenSammi @sumitagrawl |
|
Failed Test |
|
Thank you @whbing for the contribution. |

What changes were proposed in this pull request?
Let directory inherit bucket default ACLs
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8653
Please replace this section with the link to the Apache JIRA)
How was this patch tested?
Tested CLI commands in ozone compose environment.