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

Yongjun Zhang commented on HDFS-12201:
--------------------------------------

Thanks [~manojg] for working on this issue, and [~daryn] for commenting.

HI [~daryn],

{quote}
 One of the worst cases may be the NN inadvertently edit log the "fake" 
attributes.
{quote}
This is the issue that I try to solve with HDFS-12202: when we distcp from 
srcCluster to dstCluter, if external attribute provider is enabled in 
srcCluster, distcp would copy data from srcCluster's external attribute 
provider and save to tgtCluster's edit log and fsimage. The solution proposed 
in HDFS-12202 is to add new set of APIs to bypass external attribute provider 
when reading metadata, so distcp could use this set of API.

However, the change proposed in HDFS-12202 might be too disruptive because 1. 
it adds new API to stable FileSystem interface, 2. all downstream code will 
need to implement the APIs. But I don't see better/cleaner solution at this 
point. Would appreciate if you share your thoughts and comments there.

Thanks.
 

> INode#getSnapshotINode() should get INodeAttributes from 
> INodeAttributesProvider for the current INode
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-12201
>                 URL: https://issues.apache.org/jira/browse/HDFS-12201
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: snapshots
>    Affects Versions: 2.8.0
>            Reporter: Manoj Govindassamy
>            Assignee: Manoj Govindassamy
>         Attachments: HDFS-12201.test.01.patch
>
>
> Problem: When an external INodeAttributesProvider is enabled, SnapshotDiff is 
> not detecting changes in files when the external ACL/XAttr attributes change. 
> {{FileWithSnapshotFeature#changedBetweenSnapshots()}} when trying to detect 
> changes in snapshots for the given file, does meta data comparison which 
> takes in the attributes retrieved from {{INode#getSnapshotINode()}}
> {{INodeFile}}
> {noformat}
>   @Override
>   public INodeFileAttributes getSnapshotINode(final int snapshotId) {
>     FileWithSnapshotFeature sf = this.getFileWithSnapshotFeature();
>     if (sf != null) {
>       return sf.getDiffs().getSnapshotINode(snapshotId, this);
>     } else {
>       return this;
>     }
>   }
> {noformat}
> {{AbstractINodeDiffList#getSnapshotINode}}
> {noformat}
>   public A getSnapshotINode(final int snapshotId, final A currentINode) {
>     final D diff = getDiffById(snapshotId);
>     final A inode = diff == null? null: diff.getSnapshotINode();
>     return inode == null? currentINode: inode;
>   }
> {noformat}
> But, INodeFile, INodeDirectory #getSnapshotINode() returns the current 
> INode's local INodeAttributes if there is anything available for the given 
> snapshot id. When there is an INodeAttributesProvider configured, attributes 
> provided by the external provider could be different from the local. But, 
> getSnapshotINode() always returns the local attributes without retrieving 
> them from attributes provider. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to