Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-15477 Enforce ordered snapshot deletion
  3. HDFS-15689

allow/disallowSnapshot on EZ roots shouldn't fail due to trash provisioning/emptiness check

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.0
    • Component/s: hdfs
    • Target Version/s:

      Description

      Background

      1. HDFS-15607 added a feature that when dfs.namenode.snapshot.trashroot.enabled=true, allowSnapshot will automatically create a .Trash directory immediately after allowSnapshot operation so files deleted will be moved into the trash root inside the snapshottable directory.
      2. HDFS-15539 prevents admins from disallowing snapshot if the trash root inside is not empty

      Problem

      1. When dfs.namenode.snapshot.trashroot.enabled=true, currently if the directory (to be allowed snapshot on) is an EZ root, it throws FileAlreadyExistsException because the trash root already exists (encryption zone has already created an internal trash root).
      2. Similarly, at the moment if we disallow snapshot on an EZ root, it may complain that the trash root is not empty (or delete it if empty, which is not desired since EZ will still need it).

      Solution

      1. Let allowSnapshot succeed by not throwing FileAlreadyExistsException, but informs the admin that the trash already exists.
      2. Ignore checkTrashRootAndRemoveIfEmpty() check if path is EZ root.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smeng Siyao Meng
                Reporter:
                smeng Siyao Meng
              • Votes:
                0 Vote for this issue
                Watchers:
                1 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 - 2.5h
                  2.5h