hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-13838) WebHdfsFileSystem.getFileStatus() won't return correct "snapshot enabled" status
Date Fri, 31 Aug 2018 02:44:02 GMT

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

Hudson commented on HDFS-13838:

SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #14855 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/14855/])
Revert "HDFS-13838. WebHdfsFileSystem.getFileStatus() won't return (weichiu: rev 8aa6c4f079fd38a3230bc070c2ce837fefbc5301)
* (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
* (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java

> WebHdfsFileSystem.getFileStatus() won't return correct "snapshot enabled" status
> --------------------------------------------------------------------------------
>                 Key: HDFS-13838
>                 URL: https://issues.apache.org/jira/browse/HDFS-13838
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs, webhdfs
>    Affects Versions: 3.1.0, 3.0.3
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>         Attachments: HDFS-13838.001.patch, HDFS-13838.002.patch
> "Snapshot enabled" status has been added in HDFS-12455 by [~ajaykumar].
> However, it is found by [~jojochuang] that WebHdfsFileSystem.getFileStatus() won't return
the correct "snapshot enabled" status. The reason is that JsonUtilClient.toFileStatus() did
not check and append the "snapshot enabled" flag to the resulting HdfsFileStatus object.
> Proof:
> In TestWebHDFS#testWebHdfsAllowandDisallowSnapshots(), add the following lines indicated
by prepending "+":
> {code:java}
> // allow snapshots on /bar using webhdfs
> webHdfs.allowSnapshot(bar);
> +// check if snapshot status is enabled
> +assertTrue(dfs.getFileStatus(bar).isSnapshotEnabled());
> +assertTrue(webHdfs.getFileStatus(bar).isSnapshotEnabled());
> {code} 
> The first assertion will pass, as expected, while the second assertion will fail because
of the reason above.
> Update:
> A further investigation shows that FSOperations.toJsonInner() also doesn't check the
"snapshot enabled" bit. Therefore, "fs.getFileStatus(path).isSnapshotEnabled()" will always
return false for fs type HttpFSFileSystem/WebHdfsFileSystem/SWebhdfsFileSystem. This will
be addressed in a separate jira HDFS-13886.

This message was sent by Atlassian JIRA

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

View raw message