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

INode#getSnapshotINode() should get INodeAttributes from INodeAttributesProvider for the current INode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.8.0
    • Fix Version/s: 3.0.0-beta1
    • Component/s: snapshots
    • Labels:
      None

      Description

      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

        @Override
        public INodeFileAttributes getSnapshotINode(final int snapshotId) {
          FileWithSnapshotFeature sf = this.getFileWithSnapshotFeature();
          if (sf != null) {
            return sf.getDiffs().getSnapshotINode(snapshotId, this);
          } else {
            return this;
          }
        }
      

      AbstractINodeDiffList#getSnapshotINode

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

      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.

        Attachments

        1. HDFS-12201.test.01.patch
          6 kB
          Manoj Govindassamy

          Activity

            People

            • Assignee:
              manojg Manoj Govindassamy
              Reporter:
              manojg Manoj Govindassamy
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: