You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "leizhang (Jira)" <ji...@apache.org> on 2021/04/25 06:54:00 UTC

[jira] [Updated] (HDFS-15996) RBF: federation-rename by distcp should restore the permission of both src and dst when execute DistCpProcedure#restorePermission

     [ https://issues.apache.org/jira/browse/HDFS-15996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

leizhang updated HDFS-15996:
----------------------------
    Summary: RBF: federation-rename by distcp  should restore the permission of both src and dst when execute DistCpProcedure#restorePermission  (was: RBF: federation-rename by distcp  use the wrong path when execute DistCpProcedure#restorePermission)

> 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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org