Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-602

Atempt to make a directory under an existing file on DistributedFileSystem should throw an FileAlreadyExistsException instead of FileNotFoundException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: hdfs-client, namenode
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed

      Description

      Atempt to make a directory under an existing file on DistributedFileSystem should throw an FileAlreadyExistsException instead of FileNotFoundException.
      Also we should unwrap this exception from RemoteException

      1. HDFS-602.patch
        4 kB
        Boris Shkolnik

        Issue Links

          Activity

          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12418972/HDFS-602.patch
          against trunk revision 812701.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/artifact/trunk/build/test/checkstyle-errors.html
          Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12418972/HDFS-602.patch against trunk revision 812701. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/17/console This message is automatically generated.
          Hide
          Boris Shkolnik added a comment -

          No test included because it is covered by FileSystemContractBaseTest.testMkdirsFailsForSubdirectoryOfExistingFile()

          Show
          Boris Shkolnik added a comment - No test included because it is covered by FileSystemContractBaseTest.testMkdirsFailsForSubdirectoryOfExistingFile()
          Hide
          Jitendra Nath Pandey added a comment -

          +1
          look good.

          Show
          Jitendra Nath Pandey added a comment - +1 look good.
          Hide
          Suresh Srinivas added a comment -

          Minor comment - FileAlreadyExistsException does not seem appropriate in this scenario. Could IOException be used instead?

          Show
          Suresh Srinivas added a comment - Minor comment - FileAlreadyExistsException does not seem appropriate in this scenario. Could IOException be used instead?
          Hide
          Boris Shkolnik added a comment -

          I think IOException is too generic. FileAlreadyExistsException conveys the essence of the problem.

          Show
          Boris Shkolnik added a comment - I think IOException is too generic. FileAlreadyExistsException conveys the essence of the problem.
          Hide
          Suresh Srinivas added a comment -

          Here is the description for FileAlreadyExistsException: Used when target file already exists for any operation and is not configured to be overwritten.

          In this case, the intention of the exception is different. It does not indicate the target already exists. It indicates that the parent directory of the target is a file. Given this, I do not think the exception is appropriate.

          Show
          Suresh Srinivas added a comment - Here is the description for FileAlreadyExistsException: Used when target file already exists for any operation and is not configured to be overwritten. In this case, the intention of the exception is different. It does not indicate the target already exists. It indicates that the parent directory of the target is a file. Given this, I do not think the exception is appropriate.
          Hide
          Boris Shkolnik added a comment -

          We created this exception for this purpose and used it in LocalFileSystem and mapred.

          Show
          Boris Shkolnik added a comment - We created this exception for this purpose and used it in LocalFileSystem and mapred.
          Hide
          Suresh Srinivas added a comment -

          I just committed this. Thank you Boris.

          Show
          Suresh Srinivas added a comment - I just committed this. Thank you Boris.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #28 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/28/)
          . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #28 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/28/ ) . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #81 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/81/)
          . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #81 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/81/ ) . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.
          Hide
          Hudson added a comment -

          Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #26 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/26/)

          Show
          Hudson added a comment - Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #26 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/26/ )
          Hide
          Hudson added a comment -

          Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #6 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/6/)
          . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.

          Show
          Hudson added a comment - Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #6 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/6/ ) . DistributedFileSystem mkdirs command throws FileAlreadyExistsException instead of FileNotFoundException. Contributed by Boris Shkolnik.
          Hide
          Robert Chansler added a comment -

          Editorial pass over all release notes prior to publication of 0.21.

          Show
          Robert Chansler added a comment - Editorial pass over all release notes prior to publication of 0.21.

            People

            • Assignee:
              Boris Shkolnik
              Reporter:
              Boris Shkolnik
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development