[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix OzoneBucket and RpcClient APIS for acl.

2019-08-09 Thread GitBox
xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix 
OzoneBucket and RpcClient APIS for acl.
URL: https://github.com/apache/hadoop/pull/1257#discussion_r312675211
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java
 ##
 @@ -134,17 +132,6 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
   bucketInfoBuilder.addAllMetadata(KeyValueUtil
   .getFromProtobuf(bucketArgs.getMetadataList()));
 
-  //Check ACLs to update
-  if (omBucketArgs.getAddAcls() != null ||
-  omBucketArgs.getRemoveAcls() != null) {
-bucketInfoBuilder.setAcls(getUpdatedAclList(oldBucketInfo.getAcls(),
-omBucketArgs.getRemoveAcls(), omBucketArgs.getAddAcls()));
-LOG.debug("Updating ACLs for bucket: {} in volume: {}",
-bucketName, volumeName);
-  } else {
-bucketInfoBuilder.setAcls(oldBucketInfo.getAcls());
 
 Review comment:
   We have a similar problem here because OMBucketArgs does not have acls, we 
will need to rely on the oldBucketInfo.getAcls to avoid reset existing acl on 
bucket.
   
   bucketInfoBuilder.setAcls(oldBucketInfo.getAcls());


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix OzoneBucket and RpcClient APIS for acl.

2019-08-09 Thread GitBox
xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix 
OzoneBucket and RpcClient APIS for acl.
URL: https://github.com/apache/hadoop/pull/1257#discussion_r312675211
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java
 ##
 @@ -134,17 +132,6 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
   bucketInfoBuilder.addAllMetadata(KeyValueUtil
   .getFromProtobuf(bucketArgs.getMetadataList()));
 
-  //Check ACLs to update
-  if (omBucketArgs.getAddAcls() != null ||
-  omBucketArgs.getRemoveAcls() != null) {
-bucketInfoBuilder.setAcls(getUpdatedAclList(oldBucketInfo.getAcls(),
-omBucketArgs.getRemoveAcls(), omBucketArgs.getAddAcls()));
-LOG.debug("Updating ACLs for bucket: {} in volume: {}",
-bucketName, volumeName);
-  } else {
-bucketInfoBuilder.setAcls(oldBucketInfo.getAcls());
 
 Review comment:
   We have a similar problem here because OMBucketArgs does not have acls, we 
will need to rely on the oldBucketInfo.getAcls to avoid reset existing acl on 
bucket.
   
   bucketInfoBuilder.setAcls(oldBucketInfo.getAcls());


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix OzoneBucket and RpcClient APIS for acl.

2019-08-09 Thread GitBox
xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix 
OzoneBucket and RpcClient APIS for acl.
URL: https://github.com/apache/hadoop/pull/1257#discussion_r312674369
 
 

 ##
 File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
 ##
 @@ -388,7 +388,9 @@ public void deleteVolume(String volumeName) throws 
IOException {
   @Override
   public void createBucket(String volumeName, String bucketName)
   throws IOException {
-createBucket(volumeName, bucketName, BucketArgs.newBuilder().build());
+// Set acls of current user.
+createBucket(volumeName, bucketName,
+BucketArgs.newBuilder().setAcls(getAclList()).build());
 
 Review comment:
   This will cause creator acls added twice into the final list because the 
same list will be added again when the passin bucketArgs has a non-empty acl 
list. 
   {code}
   List listOfAcls = getAclList();
   //ACLs from BucketArgs
   if(bucketArgs.getAcls() != null) {
 listOfAcls.addAll(bucketArgs.getAcls());
   }
   {code}
   
   The list of acls are not merged properly when using List#addAll, which will 
be fixed in HDDS-1927. 
   Let's file a separate JIRA for RpcClient#createBucket issue. 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix OzoneBucket and RpcClient APIS for acl.

2019-08-09 Thread GitBox
xiaoyuyao commented on a change in pull request #1257: HDDS-1913. Fix 
OzoneBucket and RpcClient APIS for acl.
URL: https://github.com/apache/hadoop/pull/1257#discussion_r312567041
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -272,16 +272,6 @@ public void setBucketProperty(OmBucketArgs args) throws 
IOException {
   .setBucketName(oldBucketInfo.getBucketName());
   bucketInfoBuilder.addAllMetadata(args.getMetadata());
 
-  //Check ACLs to update
-  if (args.getAddAcls() != null || args.getRemoveAcls() != null) {
-bucketInfoBuilder.setAcls(getUpdatedAclList(oldBucketInfo.getAcls(),
-args.getRemoveAcls(), args.getAddAcls()));
-LOG.debug("Updating ACLs for bucket: {} in volume: {}",
-bucketName, volumeName);
-  } else {
-bucketInfoBuilder.setAcls(oldBucketInfo.getAcls());
 
 Review comment:
   We need to keep bucketInfoBuilder.setAcls(oldBucketInfo.getAcls()) otherwise 
existing acls will be lost upon setBucketProperty. Can you add a unit test to 
cover this?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org