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

HDFS OIV temporary dir deletes folder

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.4, 3.1.2, 3.3.0, 3.2.1
    • Component/s: hdfs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The Hadoop Offline Image Viewer tool has an undocumented 'feature' where it will silently delete the directory passed in with the -t flag. This blew away some important files when someone used a sensible, but ultimately poor choice for this directory as the deletion isn't documented.

      For example, if someone were, as root do: 'hdfs oiv -i fsimage_00000000000307052343 -p Delimited -t / -o image', bad things would happen. This behavior should be documented and probably have a dialog or throwing exception.

      There is a piece of code from PBImageTextWriter where a check can be added:

      LevelDBMetadataMap(String baseDir) throws IOException {
        File dbDir = new File(baseDir);
        if (dbDir.exists()) {
          FileUtils.deleteDirectory(dbDir);
        }
        ...
      

        Attachments

          Activity

            People

            • Assignee:
              adam.antal Adam Antal
              Reporter:
              adam.antal Adam Antal
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: