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 "Shilun Fan (Jira)" <ji...@apache.org> on 2024/01/04 07:22:00 UTC

[jira] [Commented] (HDFS-12194) File and Directory metadataEquals() does incorrect comparisons for Features

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

Shilun Fan commented on HDFS-12194:
-----------------------------------

Bulk update: moved all 3.4.0 non-blocker issues, please move back if it is a blocker. Retarget 3.5.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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org