Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2112

Ozone rename is behaving different compared with HDFS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Ozone Filesystem
    • None

    Description

      I am attaching a patch file, that introduces two new tests for the OzoneFileSystem implementation which demonstrates the expected behaviour.

      Case 1:
      Given a directory a file "/source/subdir/file", and a directory /target
      When fs.rename("/source/subdir/file", "/target/subdir/file") is called
      Then DistributedFileSystem (HDFS), is returning false from the method, while OzoneFileSystem throws a FileNotFoundException as "/target/subdir" is not existing.

      The expected behaviour would be to return false in this case instead of throwing an exception with that behave the same as DistributedFileSystem does.

       

      Case 2:
      Given a directory "/source" and a file "/targetFile"
      When fs.rename("/source", "/targetFile") is called
      Then DistributedFileSystem (HDFS), is returning false from the method, while OzoneFileSystem throws a FileAlreadyExistsException as "/targetFile" does exist.

      The expected behaviour would be to return false in this case instead of throwing an exception with that behave the same as DistributedFileSystem does.

       

      It may be considered as well a bug in HDFS, however it is not clear from the FileSystem interface's documentation on the two rename methods that it defines in which cases an exception should be thrown and in which cases a return false is the expected behaviour.

      Attachments

        1. demonstrative_test.patch
          2 kB
          István Fajth

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pifta István Fajth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: