Details
Description
"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 "+":
// 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());
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.
Attachments
Attachments
Issue Links
- blocks
-
HDFS-13886 HttpFSFileSystem.getFileStatus() doesn't return "snapshot enabled" bit
- Resolved
- is caused by
-
HDFS-12455 WebHDFS - Adding "snapshot enabled" status to ListStatus query result.
- Resolved
-
HDFS-13141 WebHDFS: Add support for getting snasphottable directory list
- Resolved
- is related to
-
HDFS-13830 Backport HDFS-13141 to branch-3.0: WebHDFS: Add support for getting snasphottable directory list
- Resolved