hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pranay Singh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-13868) WebHDFS: GETSNAPSHOTDIFF API NPE when param "snapshotname" is given but "oldsnapshotname" is not.
Date Tue, 11 Sep 2018 19:23:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-13868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611129#comment-16611129
] 

Pranay Singh commented on HDFS-13868:
-------------------------------------

Hi Wei-Chiu,

If you are referring to changes in DFSClient.java for Illegal argument that code path will
not be exercised in this case for webHDFS

The below code is equivalent to the below CLI, which compares between the snapshot s1 and
the current branch.
diffReport = webHdfs.getSnapshotDiffReport(foo, "s1", null);
Assert.assertEquals(diffReport.getDiffList().size(), 5);

 CLI for snapshot diff
---------------------------
hdfs snapshotDiff /  s1 ""

Since 5 files have been changed after taking snapshot s2 in the current branch all the five
files should be part of the result.
Hence the diffReport count should be 5.



> WebHDFS: GETSNAPSHOTDIFF API NPE when param "snapshotname" is given but "oldsnapshotname"
is not.
> -------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-13868
>                 URL: https://issues.apache.org/jira/browse/HDFS-13868
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs, webhdfs
>    Affects Versions: 3.1.0, 3.0.3
>            Reporter: Siyao Meng
>            Assignee: Pranay Singh
>            Priority: Major
>         Attachments: HDFS-13868.001.patch, HDFS-13868.002.patch, HDFS-13868.003.patch,
HDFS-13868.004.patch
>
>
> HDFS-13052 implements GETSNAPSHOTDIFF for WebHDFS.
>  
> Proof:
> {code:java}
> # 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}{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message