-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-6938. handle NPE when removing prefixAcl #3568
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
|
Testing: bash-4.2$ kinit -kt /etc/security/keytabs/testuser.keytab testuser/[email protected]
bash-4.2$ ozone shell volume create /vol1
bash-4.2$ ozone shell bucket create /vol1/bucket1
bash-4.2$ ozone shell key put /vol1/bucket1/prefix/key1 ./CONTRIBUTING.md
bash-4.2$ ozone shell key put /vol1/bucket1/prefix/p/key2 ./CONTRIBUTING.md
bash-4.2$ ozone shell prefix removeacl --acls=user:mohanad.elsafty:a /vol1/bucket1/prefix/
PREFIX_NOT_FOUND No prefix info for the prefix path: /vol1/bucket1/prefix/
bash-4.2$ ozone shell prefix removeacl --acls=user:mohanad.elsafty:a /vol1/bucket1/prefix/key1xyz
PREFIX_NOT_FOUND No prefix info for the prefix path: /vol1/bucket1/prefix/key1xyzOM Log Earlier before this update, the OM will be terminated due to NullPointerException at this line |
ayushtkn
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.
Please add a unit test for the change
aswinshakil
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 for working on this. I have some comments inline. Can you add a Unit Test as suggested by @ayushtkn
...ager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/prefix/OMPrefixAclRequest.java
Outdated
Show resolved
Hide resolved
...ager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/prefix/OMPrefixAclRequest.java
Outdated
Show resolved
Hide resolved
|
@mohan3d Thanks for working on the fix. Please try to avoid force-push when updating the PR. Here are some great articles that explain why: https://developers.mattermost.com/blog/submitting-great-prs/#4-avoid-force-pushing |
|
Thanks @adoroszlai ! will be careful next time. |
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 @mohan3d for updating the patch, LGTM.
@aswinshakil @ayushtkn would you like to take another look?
| */ | ||
| public class TestOMPrefixRemoveAclRequest extends TestOMKeyRequest { | ||
|
|
||
| @Test |
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.
Do we need a new test class for this?
Can't we adjust it in some existing class? like TestOMPrefixAclRequest?
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.
Not really, I thought it would be cleaner to have corresponding testing class for RemoveAcl. Yeah it can be done their as well.
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.
The change is in OMPrefixAclRequest.java and if we have a corresponding test class TestOMPrefixAclRequest
better to add tests there only unless there are issues doing so.
Not very convinced with having one-one test class for each use case. Better keep all the related tests in one place only
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.
@ayushtkn updated accordingly.
ayushtkn
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.
LGTM
|
@mohan3d Thanks for your contribution. @adoroszlai @aswinshakil @ayushtkn Thanks for your review! Merged |
* master: (46 commits) HDDS-6901. Configure HDDS volume reserved as percentage of the volume space. (apache#3532) HDDS-6978. EC: Cleanup RECOVERING container on DN restarts (apache#3585) HDDS-6982. EC: Attempt to cleanup the RECOVERING container when reconstruction failed at coordinator. (apache#3583) HDDS-6968. Addendum: [Multi-Tenant] Fix USER_MISMATCH error even on correct user. (apache#3578) HDDS-6794. EC: Analyze and add putBlock even on non writing node in the case of partial single stripe. (apache#3514) HDDS-6900. Propagate TimeoutException for all SCM HA Ratis calls. (apache#3564) HDDS-6938. handle NPE when removing prefixAcl (apache#3568) HDDS-6960. EC: Implement the Over-replication Handler (apache#3572) HDDS-6979. Remove unused plexus dependency declaration (apache#3579) HDDS-6957. EC: ReplicationManager - priortise under replicated containers (apache#3574) HDDS-6723. Close Rocks objects properly in OzoneManager (apache#3400) HDDS-6942. Ozone Buckets/Objects created via S3 should not allow group access (apache#3553) HDDS-6965. Increase timeout for basic check (apache#3563) HDDS-6969. Add link to compose directory in smoketest README (apache#3567) HDDS-6970. EC: Ensure DatanodeAdminMonitor can handle EC containers during decommission (apache#3573) HDDS-6977. EC: Remove references to ContainerReplicaPendingOps in TestECContainerReplicaCount (apache#3575) HDDS-6217. Cleanup XceiverClientGrpc TODOs, and document how the client works and should be used. (apache#3012) HDDS-6773. Cleanup TestRDBTableStore (apache#3434) - fix checkstyle HDDS-6773. Cleanup TestRDBTableStore (apache#3434) HDDS-6676. KeyValueContainerData#getProtoBufMessage() should set block count (apache#3371) ... Conflicts: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java
What changes were proposed in this pull request?
Handle the case when removing prefixAcl of a non-existing prefix (A prefix that has no acls set before, or invalid prefix). it throws NPE if no acls are there.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6938
How was this patch tested?
unittest/manual tests.