Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13868

WebHDFS: GETSNAPSHOTDIFF API NPE when param "snapshotname" is given but "oldsnapshotname" is not.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0, 3.0.3
    • 3.2.0, 3.0.4, 3.1.2
    • hdfs, webhdfs
    • None

    Description

      HDFS-13052 implements GETSNAPSHOTDIFF for WebHDFS.

       

      Proof:

      # Bash
      
      # Prerequisite: You will need to create the directory "/snapshot", allowSnapshot() on it, and create a snapshot named "snap3" for it to reach NPE.
      
      $ curl "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=GETSNAPSHOTDIFF&user.name=hdfs&oldsnapshotnameZZZ=snap2&snapshotname=snap3"
      # Note that I intentionally typed the wrong parameter name for "oldsnapshotname" above to cause NPE.
      
      {"RemoteException":{"exception":"NullPointerException","javaClassName":"java.lang.NullPointerException","message":null}}
      
      
      # OR
      
      $ curl "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=GETSNAPSHOTDIFF&user.name=hdfs&oldsnapshotname=&snapshotname=snap3"
      # Empty string for oldsnapshotname
      
      {"RemoteException":{"exception":"NullPointerException","javaClassName":"java.lang.NullPointerException","message":null}}
      
      
      # OR
      
      $ curl "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=GETSNAPSHOTDIFF&user.name=hdfs&snapshotname=snap3"
      # Missing param oldsnapshotname, essentially the same as the first case.
      
      {"RemoteException":{"exception":"NullPointerException","javaClassName":"java.lang.NullPointerException","message":null}

      Attachments

        1. HDFS-13868.branch-3.0.001.patch
          4 kB
          Wei-Chiu Chuang
        2. HDFS-13868.004.patch
          4 kB
          Pranay Singh
        3. HDFS-13868.003.patch
          4 kB
          Pranay Singh
        4. HDFS-13868.002.patch
          3 kB
          Pranay Singh
        5. HDFS-13868.001.patch
          1 kB
          Pranay Singh

        Issue Links

          Activity

            People

              pranay_singh Pranay Singh
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: