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

Siyao Meng commented on HDFS-13838:
-----------------------------------

[~jojochuang]

1&2. So far in the trunk, the only reference to the JSON key "snapshotEnabled" 
is in the JsonUtil.java. Since the same key in HttpFS is "seBit" 
(HttpFSFileSystem.java:202), the cleanest way to do this is by changing 
"snapshotEnabled" in WebHDFS to "seBit", since the naming convention for other 
properties are "aclBit", "encBit", "ecBit". Indeed there is a workaround, that 
is to have both "seBit" AND "snapshotEnabled" and somehow mark the latter as 
deprecated. Would this satisfy the compatibility requirement?
3. Okay. Do I submit the doc change and code change in one patch?

> 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, 
> HDFS-13838.003.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
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to