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

Shilun Fan updated HDFS-12194:
------------------------------
    Target Version/s: 3.5.0  (was: 3.4.0)

> File and Directory metadataEquals() does incorrect comparisons for Features
> ---------------------------------------------------------------------------
>
>                 Key: HDFS-12194
>                 URL: https://issues.apache.org/jira/browse/HDFS-12194
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: snapshots
>    Affects Versions: 2.8.0
>            Reporter: Manoj Govindassamy
>            Assignee: Manoj Govindassamy
>            Priority: Major
>
> When calculating snapshot diff, the metadata comparisons for Files and 
> Directories are doing object reference equality (==) check instead of the 
> equals() check. So, a file with the ACL set exactly same as the old one will 
> still be flagged as changed. 
> INodeFile and SnapshotCopy #metadataEquals()  
> {noformat}
> @Override
>   public boolean metadataEquals(INodeFileAttributes other) {
>     return other != null
>         && getHeaderLong()== other.getHeaderLong()
>         && getPermissionLong() == other.getPermissionLong()
>         && getAclFeature() == other.getAclFeature()
>         && getXAttrFeature() == other.getXAttrFeature();
>   }
> {noformat}
> INodeDirectory, SnapshotCopy #metadataEquals()
> {noformat}
>   @Override
>   public boolean metadataEquals(INodeDirectoryAttributes other) {
>     return other != null
>         && getQuotaCounts().equals(other.getQuotaCounts())
>         && getPermissionLong() == other.getPermissionLong()
>         && getAclFeature() == other.getAclFeature()
>         && getXAttrFeature() == other.getXAttrFeature();
>   }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
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