[ https://issues.apache.org/jira/browse/HIVE-24698?focusedWorklogId=549488&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-549488 ]
ASF GitHub Bot logged work on HIVE-24698: ----------------------------------------- Author: ASF GitHub Bot Created on: 08/Feb/21 10:12 Start Date: 08/Feb/21 10:12 Worklog Time Spent: 10m Work Description: ayushtkn commented on a change in pull request #1925: URL: https://github.com/apache/hive/pull/1925#discussion_r571923493 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/DirCopyTask.java ########## @@ -70,9 +76,40 @@ private boolean createAndSetPathOwner(Path destPath, Path sourcePath) throws IOE destPath, sourcePath, status.getOwner(), status.getGroup(), status.getPermission()); destPath.getFileSystem(conf).setOwner(destPath, status.getOwner(), status.getGroup()); destPath.getFileSystem(conf).setPermission(destPath, status.getPermission()); + setAclsToTarget(status, sourcePath, destPath); return createdDir; } + private void setAclsToTarget(FileStatus sourceStatus, Path sourcePath, + Path destPath) throws IOException { + // Check if distCp options contains preserve ACL. + if (isPreserveAcl()) { + AclStatus sourceAcls = + sourcePath.getFileSystem(conf).getAclStatus(sourcePath); + if (sourceAcls != null && sourceAcls.getEntries().size() > 0) { + destPath.getFileSystem(conf).removeAcl(destPath); Review comment: I followed the same semantics as DistCp, DistCp also does removeAcl first, added as part of HADOOP-16032. The reason being if the directory at the target has ACCESS scope ACL and the directory at source has only Default ACL, so setAcl will not remove the ACCESS scope ACL, hence the ACL's on source & dest won't be same. So, to counter that removeACl is called first. ---------------------------------------------------------------- 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 Issue Time Tracking ------------------- Worklog Id: (was: 549488) Time Spent: 0.5h (was: 20m) > Sync ACL's for the table directory during external table replication. > --------------------------------------------------------------------- > > Key: HIVE-24698 > URL: https://issues.apache.org/jira/browse/HIVE-24698 > Project: Hive > Issue Type: Bug > Reporter: Ayush Saxena > Assignee: Ayush Saxena > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Set similar ACL's to destination table directory in case the source has ACL's > enabled or set. -- This message was sent by Atlassian Jira (v8.3.4#803005)