leizhang created HDFS-15996:
-------------------------------

             Summary: RBF: federation-rename by distcp  use the wrong path 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


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) {
        descFs.modifyAclEntries(desc, acl.getEntries());
    }
    if (fPerm != null) {
        srcFs.setPermission(src, fPerm);
    }
}
{code}
i think method restorePermission operate the wrong path (current  desc , expect 
 src);

 



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

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

Reply via email to