Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17907

FileUtil#fullyDelete deletes contents of sym-linked directory when symlink cannot be deleted because of local fs fault

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.4.0
    • fs
    • Reviewed

    Description

      As discussed in HADOOP-6536, FileUtil#fullyDelete should not delete the contents of the sym-linked directory when we pass a symlink parameter. Currently we try to delete the resource first by calling deleteImpl, and if deleteImpl is failed, we regard it as non-empty directory and remove all its contents and then itself. This logic behaves wrong when local file system cannot delete symlink to a directory because of faulty disk, local system's error, etc. When we cannot delete it in the first time, hadoop will try to remove all the contents of the directory it pointed to and leave an empty dir.
      So, we should add an isSymlink checking before we call fullyDeleteContents to prevent such behavior.

       

      Attachments

        Issue Links

          Activity

            People

              Weihao Zheng Weihao Zheng
              Weihao Zheng Weihao Zheng
              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 - 1.5h
                  1.5h