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

          Boris Shkolnik created issue -
          Boris Shkolnik made changes -
          Field Original Value New Value
          Link This issue is part of HDFS-303 [ HDFS-303 ]
          Boris Shkolnik made changes -
          Summary Atempt to make a directory under an existing file on DistributedFileSystem should throw an FileAlreadyExitsException instead of FileNotFoundException Atempt to make a directory under an existing file on DistributedFileSystem should throw an FileAlreadyExistsException instead of FileNotFoundException
          Description Atempt to make a directory under an existing file on DistributedFileSystem should throw an FileAlreadyExitsException instead of FileNotFoundException.
          Also we should unwrap this exception from RemoteException
          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
          Boris Shkolnik made changes -
          Attachment HDFS-602.patch [ 12418972 ]
          Boris Shkolnik made changes -
          Assignee Boris Shkolnik [ boryas ]
          Boris Shkolnik made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          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.
          Suresh Srinivas made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags [Incompatible change] [Incompatible change, Reviewed]
          Release Note  DistributedFileSystem mkdirs throws FileAlreadyExistsException instead of FileNotFoundException.
          Fix Version/s 0.21.0 [ 12314046 ]
          Resolution Fixed [ 1 ]
          Suresh Srinivas made changes -
          Component/s hdfs client [ 12312928 ]
          Component/s name-node [ 12312926 ]
          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/ )
          Tsz Wo Nicholas Sze made changes -
          Link This issue is related to HDFS-617 [ HDFS-617 ]
          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.
          Robert Chansler made changes -
          Release Note  DistributedFileSystem mkdirs throws FileAlreadyExistsException instead of FileNotFoundException.
          Tom White made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          6h 3m 1 Boris Shkolnik 09/Sep/09 00:46
          Patch Available Patch Available Resolved Resolved
          2d 17h 47m 1 Suresh Srinivas 11/Sep/09 18:33
          Resolved Resolved Closed Closed
          347d 3h 15m 1 Tom White 24/Aug/10 21:49

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development