HDDS-6938. handle NPE when removing prefixAcl#3568
HDDS-6938. handle NPE when removing prefixAcl#3568ferhui merged 5 commits intoapache:masterfrom mohan3d:HDDS-6938
Conversation
|
Testing: bash-4.2$ kinit -kt /etc/security/keytabs/testuser.keytab testuser/scm@EXAMPLE.COM
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.
Please add a unit test for the change
aswinshakil
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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
|
@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.