You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Jing Zhao (JIRA)" <ji...@apache.org> on 2013/03/04 21:09:12 UTC
[jira] [Commented] (HDFS-4545) Snapshot: unprotectedSetReplication
may update diskspace count incorrectly
[ https://issues.apache.org/jira/browse/HDFS-4545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13592577#comment-13592577 ]
Jing Zhao commented on HDFS-4545:
---------------------------------
The patch looks good. Only a question about the changes in INodesInPath. For operations such as renaming snapshots etc, INodeDirectory#getLastINodeInPath
will first be called, and INodesInPath#getINode(0) is called to get the correspond inode (i.e., FSDirectory#getINode). When a wrong path ending with ".snapshot" is given, before the change, a null inode will be returned by this sequence of calls, and a FileNotFoundException will be thrown to the end user. After the change, we will get an ArrayIndexOutOfBoundsException in INodesInPath#getINode. An example testcase is:
{noformat}
@Test
public void testRenameSnapshotWithWrongPath() throws Exception {
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
// Create three snapshots for sub1
SnapshotTestHelper.createSnapshot(hdfs, sub1, "s1");
Path wrongPath = new Path(sub1, HdfsConstants.DOT_SNAPSHOT_DIR);
try {
hdfs.renameSnapshot(wrongPath, "s1", "s2");
fail("");
} catch (FileNotFoundException e) {}
}
{noformat}
So I think we may also need to add extra check for paths ending with ".snapshot" for corresponding operaitons (before trying to get the inode for the path).
> Snapshot: unprotectedSetReplication may update diskspace count incorrectly
> --------------------------------------------------------------------------
>
> Key: HDFS-4545
> URL: https://issues.apache.org/jira/browse/HDFS-4545
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Attachments: h4545_20130304.patch
>
>
> FSDirectory.unprotectedSetReplication changes file replication but it may or may not changes block replication.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira