[ 
https://issues.apache.org/jira/browse/HDFS-15996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17333145#comment-17333145
 ] 

Viraj Jasani commented on HDFS-15996:
-------------------------------------

{quote}i think both the src and dst permission need to be modify
{quote}
+1 to this idea.

> RBF: federation-rename by distcp  should restore the permission of both src 
> and dst when execute DistCpProcedure#restorePermission
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-15996
>                 URL: https://issues.apache.org/jira/browse/HDFS-15996
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: rbf
>            Reporter: leizhang
>            Priority: Major
>
> when execute rename distcp ,  we can see one step disable the write  by 
> removing the permission of src , see DistCpProcedure#disableWrite
>  
> {code:java}
> protected void disableWrite(FedBalanceContext fbcontext) throws IOException {
>     // Save and cancel permission.
>     FileStatus status = srcFs.getFileStatus(src);
>     fPerm = status.getPermission();
>     //TODO our cluster set the dfs.namenode.acls.enabled to false so skip acl 
> init,need a more reasonable way to handle this
>     //acl = srcFs.getAclStatus(src);
>     srcFs.setPermission(src, FsPermission.createImmutable((short) 0));
>     updateStage(Stage.FINAL_DISTCP);
> }
> {code}
> but when  finishDistcp and execute restoring,  it set the previous stored 
> permission of  src  to the  dest path , see  DistCpProcedure#restorePermission
> {code:java}
> /**
>  * Enable write by restoring the x permission.
>  */
> void restorePermission() throws IOException {
>     // restore permission.
>     //TODO our cluster set the dfs.namenode.acls.enabled to false so skip acl 
> init,need a more reasonable way to handle this
>     //dstFs.removeAcl(dst);
>     if (acl != null) {
>         dstFs.modifyAclEntries(dst, acl.getEntries());
>     }
>     if (fPerm != null) {
>         dstFs.setPermission(dst, fPerm);
>     }
> }
>  {code}
> i think both the src and dst permission need to be modify, because after 
> restorePermission, we need to execute the TrashProcedure , in order to move 
> the src to the correct trash dir , we switch to a custom account to execute 
> trashProcedure , when use non-admin account, the trashProcedure failed due to 
> permission problem



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to