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 03:31:00 UTC
[jira] [Updated] (HDFS-15996) RBF: federation-rename by distcp use
the wrong path 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:
----------------------------
Description:
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);
was:
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);
> 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
> 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) {
> 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-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org