Manoj Govindassamy created HDFS-12194:
-----------------------------------------

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


Looks like the metadata comparisons for Files and Directories are doing object 
reference equality instead of the equals() check. So, a file with the ACL set 
exactly same as the old one will still flag 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
(v6.4.14#64029)

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