Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.21.0, 0.22.0
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      HDFS-677 introduced check in rename to reject rename from src to dst where dst starts with src. This results in a bug where rename from /test /testFoo fails. Instead of testing dst starts with src, the check should be modified so that dst cannot be a directory or a file under src.

      1. hdfs-709.1.patch
        5 kB
        Suresh Srinivas
      2. hdfs-709.patch
        3 kB
        Suresh Srinivas

        Issue Links

          Activity

          Hide
          Suresh Srinivas added a comment -

          Attached patch fixes the bug.

          Show
          Suresh Srinivas added a comment - Attached patch fixes the bug.
          Hide
          Hairong Kuang added a comment -

          It looks good.

          What's the expected behavior if renaming directory /a/b to be /a/b/? Could you please add a unit test for this?

          Show
          Hairong Kuang added a comment - It looks good. What's the expected behavior if renaming directory /a/b to be /a/b/? Could you please add a unit test for this?
          Hide
          Suresh Srinivas added a comment -

          > What's the expected behavior if renaming directory /a/b to be /a/b/? Could you please add a unit test for this?
          It depends on what /a/b is.

          1. if /a/b is directory then rename as it is implemented tries to rename /a/b to /a/b/b. This fails since dst is a directory or file under src.
          2. If /a/b is a file, it succeeds under the condition src and dst are the same.

          Attached a new patch that adds some comments to make the rename tests with quota more clear.

          Show
          Suresh Srinivas added a comment - > What's the expected behavior if renaming directory /a/b to be /a/b/? Could you please add a unit test for this? It depends on what /a/b is. if /a/b is directory then rename as it is implemented tries to rename /a/b to /a/b/b. This fails since dst is a directory or file under src. If /a/b is a file, it succeeds under the condition src and dst are the same. Attached a new patch that adds some comments to make the rename tests with quota more clear.
          Hide
          Hairong Kuang added a comment -

          +1

          Show
          Hairong Kuang added a comment - +1
          Hide
          Suresh Srinivas added a comment -

          Hudson builds are not running. Ran the tests myself. Latest patch passes all the tests except TestBackupNode(HDFS-192):

          Here is the test-patch result:
          [exec] +1 overall.
          [exec]
          [exec] +1 @author. The patch does not contain any @author tags.
          [exec]
          [exec] +1 tests included. The patch appears to include 16 new or modified tests.
          [exec]
          [exec] +1 javadoc. The javadoc tool did not generate any warning messages.
          [exec]
          [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
          [exec]
          [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
          [exec]
          [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
          [ Show » ]
          Suresh Srinivas added a comment - 15/Oct/09 12:22 AM Latest patch passes all the tests with the following exception:

          1. org.apache.hadoop.hdfs.TestFileAppend3 (HDFS-668)
          2. org.apache.hadoop.hdfs.server.namenode.TestBackupNode(HDFS-192)

          Here is the test-patch result: [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 16 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.

          Show
          Suresh Srinivas added a comment - Hudson builds are not running. Ran the tests myself. Latest patch passes all the tests except TestBackupNode( HDFS-192 ): Here is the test-patch result: [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 16 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings. [ Show » ] Suresh Srinivas added a comment - 15/Oct/09 12:22 AM Latest patch passes all the tests with the following exception: 1. org.apache.hadoop.hdfs.TestFileAppend3 ( HDFS-668 ) 2. org.apache.hadoop.hdfs.server.namenode.TestBackupNode( HDFS-192 ) Here is the test-patch result: [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 16 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
          Hide
          Suresh Srinivas added a comment -

          Committed this change to both 21 and trunk.

          Show
          Suresh Srinivas added a comment - Committed this change to both 21 and trunk.
          Hide
          Hudson added a comment -

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

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

          Integrated in Hadoop-Hdfs-trunk-Commit #79 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/79/)

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #79 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/79/ )
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #120 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/120/)

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #120 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/120/ )
          Hide
          Hudson added a comment -

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

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

            People

            • Assignee:
              Suresh Srinivas
              Reporter:
              Suresh Srinivas
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development