Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2802 Support for RW/RO snapshots in HDFS
  3. HDFS-4781

File listing of .snapshot under a non-existing dir throws NullPointer

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Snapshot (HDFS-2802)
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      $ hadoop dfs -ls /invalidDir/.snapshot
      ls: java.io.IOException: java.lang.NullPointerException

      INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 8020, call getFileInfo(/invalidDir/.snapshot) from .* : error: java.io.IOException: java.lang.NullPointerException
      java.io.IOException: java.lang.NullPointerException
              at org.apache.hadoop.hdfs.server.namenode.FSDirectory.getFileInfo4DotSnapshot(FSDirectory.java:1208)
              at org.apache.hadoop.hdfs.server.namenode.FSDirectory.getFileInfo(FSDirectory.java:1189)
              at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getFileInfo(FSNamesystem.java:2545)
              at org.apache.hadoop.hdfs.server.namenode.NameNode.getFileInfo(NameNode.java:949)
              at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
              at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1405)
              at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1401)
              at java.security.AccessController.doPrivileged(Native Method)
              at javax.security.auth.Subject.doAs(Subject.java:396)
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1195)
              at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1399)
      
      1. h4781_20130430.patch
        4 kB
        Tsz Wo Nicholas Sze

        Activity

        Ramya Sunil created issue -
        Ramya Sunil made changes -
        Field Original Value New Value
        Component/s datanode [ 12312927 ]
        Component/s namenode [ 12312926 ]
        Jing Zhao made changes -
        Assignee Jing Zhao [ jingzhao ]
        Tsz Wo Nicholas Sze made changes -
        Assignee Jing Zhao [ jingzhao ] Tsz Wo (Nicholas), SZE [ szetszwo ]
        Component/s datanode [ 12312927 ]
        Hide
        Tsz Wo Nicholas Sze added a comment -

        h4781_20130430.patch: fixes the NPE and some javadoc warnings.

        Show
        Tsz Wo Nicholas Sze added a comment - h4781_20130430.patch: fixes the NPE and some javadoc warnings.
        Tsz Wo Nicholas Sze made changes -
        Attachment h4781_20130430.patch [ 12581327 ]
        Hide
        Jing Zhao added a comment -

        +1 for the patch.

        Show
        Jing Zhao added a comment - +1 for the patch.
        Hide
        Suresh Srinivas added a comment -

        Please add a unit test for this.

        Show
        Suresh Srinivas added a comment - Please add a unit test for this.
        Hide
        Suresh Srinivas added a comment -

        Ignore my previous comment, I missed the part that you already added it. +1.

        Show
        Suresh Srinivas added a comment - Ignore my previous comment, I missed the part that you already added it. +1.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        > Please add a unit test for this.

        The patch does have a test.

        Show
        Tsz Wo Nicholas Sze added a comment - > Please add a unit test for this. The patch does have a test.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        Thanks Jing and Suresh for reviewing the patch.

        I have committed this.

        Show
        Tsz Wo Nicholas Sze added a comment - Thanks Jing and Suresh for reviewing the patch. I have committed this.
        Tsz Wo Nicholas Sze made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-Snapshots-Branch-build #175 (See https://builds.apache.org/job/Hadoop-Hdfs-Snapshots-Branch-build/175/)
        HDFS-4781. Fix a NullPointerException when listing .snapshot under a non-existing directory. (Revision 1478135)

        Result = FAILURE
        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1478135
        Files :

        • /hadoop/common/branches/HDFS-2802/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt
        • /hadoop/common/branches/HDFS-2802/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
        • /hadoop/common/branches/HDFS-2802/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java
        • /hadoop/common/branches/HDFS-2802/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
        • /hadoop/common/branches/HDFS-2802/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSnapshotPathINodes.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-Snapshots-Branch-build #175 (See https://builds.apache.org/job/Hadoop-Hdfs-Snapshots-Branch-build/175/ ) HDFS-4781 . Fix a NullPointerException when listing .snapshot under a non-existing directory. (Revision 1478135) Result = FAILURE szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1478135 Files : /hadoop/common/branches/ HDFS-2802 /hadoop-hdfs-project/hadoop-hdfs/CHANGES. HDFS-2802 .txt /hadoop/common/branches/ HDFS-2802 /hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java /hadoop/common/branches/ HDFS-2802 /hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java /hadoop/common/branches/ HDFS-2802 /hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java /hadoop/common/branches/ HDFS-2802 /hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSnapshotPathINodes.java

          People

          • Assignee:
            Tsz Wo Nicholas Sze
            Reporter:
            Ramya Sunil
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development