Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12194

File and Directory metadataEquals() does incorrect comparisons for Features

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8.0
    • None
    • snapshots
    • None

    Description

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

      @Override
        public boolean metadataEquals(INodeFileAttributes other) {
          return other != null
              && getHeaderLong()== other.getHeaderLong()
              && getPermissionLong() == other.getPermissionLong()
              && getAclFeature() == other.getAclFeature()
              && getXAttrFeature() == other.getXAttrFeature();
        }
      

      INodeDirectory, SnapshotCopy #metadataEquals()

        @Override
        public boolean metadataEquals(INodeDirectoryAttributes other) {
          return other != null
              && getQuotaCounts().equals(other.getQuotaCounts())
              && getPermissionLong() == other.getPermissionLong()
              && getAclFeature() == other.getAclFeature()
              && getXAttrFeature() == other.getXAttrFeature();
        }
      

      Attachments

        Activity

          People

            manojg Manoj Govindassamy
            manojg Manoj Govindassamy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: