[ 
https://issues.apache.org/jira/browse/HDDS-1600?focusedWorklogId=252042&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-252042
 ]

ASF GitHub Bot logged work on HDDS-1600:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/May/19 20:33
            Start Date: 31/May/19 20:33
    Worklog Time Spent: 10m 
      Work Description: xiaoyuyao commented on pull request #857: HDDS-1600. 
Add userName and IPAddress as part of OMRequest.
URL: https://github.com/apache/hadoop/pull/857#discussion_r289541640
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
 ##########
 @@ -114,13 +116,19 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
     OMResponse.Builder omResponse = OMResponse.newBuilder().setCmdType(
         OzoneManagerProtocolProtos.Type.CreateBucket).setStatus(
         OzoneManagerProtocolProtos.Status.OK);
-    OmBucketInfo omBucketInfo = null;
-
+    OmBucketInfo omBucketInfo = OmBucketInfo.getFromProtobuf(bucketInfo);
 
-    metadataManager.getLock().acquireVolumeLock(volumeName);
-    metadataManager.getLock().acquireBucketLock(volumeName, bucketName);
 
     try {
+      // check Acl
+      if (ozoneManager.getAclsEnabled()) {
+        checkAcls(ozoneManager, OzoneObj.ResourceType.BUCKET,
+            OzoneObj.StoreType.OZONE, IAccessAuthorizer.ACLType.CREATE,
+            volumeName, bucketName, null);
+      }
+
+      metadataManager.getLock().acquireVolumeLock(volumeName);
 
 Review comment:
   I think the right lock pattern is to acquire lock out of try {} block and 
release them in the final block. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 252042)
    Time Spent: 1h 40m  (was: 1.5h)

> Add userName and IPAddress as part of OMRequest.
> ------------------------------------------------
>
>                 Key: HDDS-1600
>                 URL: https://issues.apache.org/jira/browse/HDDS-1600
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> In OM HA, the actual execution of request happens under GRPC context, so UGI 
> object which we retrieve from ProtobufRpcEngine.Server.getRemoteUser(); will 
> not be available.
> In similar manner ProtobufRpcEngine.Server.getRemoteIp().
>  
> So, during preExecute(which happens under RPC context) extract userName and 
> IPAddress and add it to the OMRequest, and then send the request to ratis 
> server.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to