Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1845

symlink comes up as directory after namenode restart

    Details

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

      Description

      When a symlink is first created, it get added to EditLogs. When namenode is restarted, it reads from this editlog and represents a symlink correctly and saves this information to its image. If the namenode is restarted again, it reads its from this FSImage, but thinks that a symlink is a directory. This is because it uses "Block[] blocks" to determine if an INode is a directory, a file, or symlink. Since both a directory and a symlink has blocks as null, it thinks that a symlink is a directory.

      1. HDFS-1845-2.patch
        4 kB
        John George
      2. hdfs-1845-branch22-1.patch
        6 kB
        Eli Collins
      3. HDFS-1845-apache-3.patch
        3 kB
        John George
      4. HDFS-1845-apache-2.patch
        4 kB
        John George
      5. HDFS-1845-apache.patch
        4 kB
        John George

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-22-branch #35 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-22-branch/35/)
        HDFS-1845. svn merge -c 1095245 from trunk

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-22-branch #35 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-22-branch/35/ ) HDFS-1845 . svn merge -c 1095245 from trunk
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #600 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/600/)

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #600 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/600/ )
        Hide
        John George added a comment -

        Yes Eli you are right. Both the patches were the same. I did not realize that there was another patch attached till after I attached this patch. Sorry for the confusion.

        Show
        John George added a comment - Yes Eli you are right. Both the patches were the same. I did not realize that there was another patch attached till after I attached this patch. Sorry for the confusion.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #643 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/643/)
        HDFS-1845. Symlink comes up as directory after namenode restart. Contributed by John George

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #643 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/643/ ) HDFS-1845 . Symlink comes up as directory after namenode restart. Contributed by John George
        Hide
        Eli Collins added a comment -

        Attaching Yahoo! specific patch for the bug.

        Do you mean for branch-0.20-security?

        I think HDFS-1845-2.patch is equivalent to hdfs-1845-branch22-1.patch.

        Show
        Eli Collins added a comment - Attaching Yahoo! specific patch for the bug. Do you mean for branch-0.20-security? I think HDFS-1845 -2.patch is equivalent to hdfs-1845-branch22-1.patch.
        Hide
        John George added a comment -

        Attaching Yahoo! specific patch for the bug.

        $ ant test-core -Dtestcase=TestCheckpoint
        ..
        ..

        checkfailure:

        BUILD SUCCESSFUL
        Total time: 37 seconds

        Show
        John George added a comment - Attaching Yahoo! specific patch for the bug. $ ant test-core -Dtestcase=TestCheckpoint .. .. checkfailure: BUILD SUCCESSFUL Total time: 37 seconds
        Hide
        Eli Collins added a comment -

        I've committed this to trunk and branch 22. Thanks John!

        Show
        Eli Collins added a comment - I've committed this to trunk and branch 22. Thanks John!
        Hide
        Eli Collins added a comment -

        org.apache.hadoop.hdfs.server.namenode.TestCheckpoint
        org.apache.hadoop.hdfs.TestFileConcurrentReader

        TestCheckpoint is fixed in the latest patch. TestFileConcurrentReader is unrelated.

        Show
        Eli Collins added a comment - org.apache.hadoop.hdfs.server.namenode.TestCheckpoint org.apache.hadoop.hdfs.TestFileConcurrentReader TestCheckpoint is fixed in the latest patch. TestFileConcurrentReader is unrelated.
        Hide
        Eli Collins added a comment -

        Patch for branch 22 attached.

        Show
        Eli Collins added a comment - Patch for branch 22 attached.
        Hide
        Eli Collins added a comment -

        +1 lgtm.

        Show
        Eli Collins added a comment - +1 lgtm.
        Hide
        John George added a comment -

        Thanks Eli. Attached a patch with Eli's suggestions.

        Show
        John George added a comment - Thanks Eli. Attached a patch with Eli's suggestions.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12476748/HDFS-1845-apache-2.patch
        against trunk revision 1094748.

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        +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 (version 1.3.9) warnings.

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

        -1 core tests. The patch failed these core unit tests:
        org.apache.hadoop.hdfs.server.namenode.TestCheckpoint
        org.apache.hadoop.hdfs.TestFileConcurrentReader

        -1 contrib tests. The patch failed contrib unit tests.

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//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/12476748/HDFS-1845-apache-2.patch against trunk revision 1094748. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +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 (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these core unit tests: org.apache.hadoop.hdfs.server.namenode.TestCheckpoint org.apache.hadoop.hdfs.TestFileConcurrentReader -1 contrib tests. The patch failed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/392//console This message is automatically generated.
        Hide
        Eli Collins added a comment -

        The fix in INode.java looks good.

        In the test you can't successfully access a symlink via FileSystem as symlinks are only implmented in FileContext (this is why TestCheckpoint is failing). You need to use FileContext#getFileLinkStatus as you want to check the isSymlink property (and getFileStatus will resolve the link).

        Nit: no need for the writeLink and checkLink utility methods since they are/can be 1-liners.

        Show
        Eli Collins added a comment - The fix in INode.java looks good. In the test you can't successfully access a symlink via FileSystem as symlinks are only implmented in FileContext (this is why TestCheckpoint is failing). You need to use FileContext#getFileLinkStatus as you want to check the isSymlink property (and getFileStatus will resolve the link). Nit: no need for the writeLink and checkLink utility methods since they are/can be 1-liners.
        Hide
        John George added a comment -

        Thanks Daryn. Attaching another patch by taking Daryn's comments into consideration.

        Show
        John George added a comment - Thanks Daryn. Attaching another patch by taking Daryn's comments into consideration.
        Hide
        Daryn Sharp added a comment -

        I think you want to call getFileStatus instead of globStatus since you don't appear to be testing a glob.

        Very minor comment: it seems like the general coding style is to use cuddled else clauses.

        Show
        Daryn Sharp added a comment - I think you want to call getFileStatus instead of globStatus since you don't appear to be testing a glob. Very minor comment: it seems like the general coding style is to use cuddled else clauses.
        Hide
        Hadoop QA added a comment -

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

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        +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 (version 1.3.9) warnings.

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

        -1 core tests. The patch failed these core unit tests:
        org.apache.hadoop.hdfs.server.namenode.TestCheckpoint
        org.apache.hadoop.hdfs.TestFileConcurrentReader

        -1 contrib tests. The patch failed contrib unit tests.

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//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/12476741/HDFS-1845-apache.patch against trunk revision 1094748. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +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 (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these core unit tests: org.apache.hadoop.hdfs.server.namenode.TestCheckpoint org.apache.hadoop.hdfs.TestFileConcurrentReader -1 contrib tests. The patch failed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/391//console This message is automatically generated.
        Hide
        John George added a comment -

        [exec]
        [exec] BUILD SUCCESSFUL
        [exec] Total time: 49 seconds
        [exec]
        [exec]
        [exec]
        [exec]
        [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 3 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 (version 1.3.9) warnings.
        [exec]
        [exec] -1 release audit. The applied patch generated 1 release audit warnings (more than the trunk's current 0 warnings).
        [exec]
        [exec] +1 system test framework. The patch passed system test framework compile.
        [exec]
        [exec]
        [exec]

        The release audit was failing even with an empty patch. So, I dont think it is this patch that caused it.

        Show
        John George added a comment - [exec] [exec] BUILD SUCCESSFUL [exec] Total time: 49 seconds [exec] [exec] [exec] [exec] [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 3 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 (version 1.3.9) warnings. [exec] [exec] -1 release audit. The applied patch generated 1 release audit warnings (more than the trunk's current 0 warnings). [exec] [exec] +1 system test framework. The patch passed system test framework compile. [exec] [exec] [exec] The release audit was failing even with an empty patch. So, I dont think it is this patch that caused it.

          People

          • Assignee:
            John George
            Reporter:
            John George
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development