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

SnapshotDiff behaviour with Xattrs and Acls is not consistent across NN restarts with checkpointing

    XMLWordPrintableJSON

Details

    Description

      The below test shows the snapshot diff between across snapshots is not consistent with Xattr(EZ here settinh the Xattr) across NN restarts with checkpointed FsImage.

      @Test
      public void testEncryptionZonesWithSnapshots() throws Exception {
        final Path snapshottable = new Path("/zones");
        fsWrapper.mkdir(snapshottable, FsPermission.getDirDefault(),
            true);
        dfsAdmin.allowSnapshot(snapshottable);
        dfsAdmin.createEncryptionZone(snapshottable, TEST_KEY, NO_TRASH);
        fs.createSnapshot(snapshottable, "snap1");
        SnapshotDiffReport report =
            fs.getSnapshotDiffReport(snapshottable, "snap1", "");
        Assert.assertEquals(0, report.getDiffList().size());
        report =
            fs.getSnapshotDiffReport(snapshottable, "snap1", "");
        System.out.println(report);
        Assert.assertEquals(0, report.getDiffList().size());
        fs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
        fs.saveNamespace();
        fs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);
        cluster.restartNameNode(true);
        report =
            fs.getSnapshotDiffReport(snapshottable, "snap1", "");
        Assert.assertEquals(0, report.getDiffList().size());
      }
      Pre Restart:
      Difference between snapshot snap1 and current directory under directory /zones:
      
      Post Restart:
      Difference between snapshot snap1 and current directory under directory /zones:
      M .

      The side effect of this behavior is : distcp with snapshot diff would fail with below error complaining that target cluster has some data changed .

      WARN tools.DistCp: The target has been modified since snapshot xxxxx
      

      Attachments

        Issue Links

          Activity

            People

              shashikant Shashikant Banerjee
              smajeti Srinivasu Majeti
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h
                  5h