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

Mingliang Liu commented on HDFS-15276:
--------------------------------------

So the problem here is we should not compare the identity using {{==}} but 
{{equals()}} method. Do you think
{code}
    Preconditions.checkState(removed.equals(child));
{code}
is better than checking the ID directly?

The patch looks good and the test also shows the problem and confirms the fix. 
One nit is to make the doc in javadoc format.
{code}
/**
 * Test concat on file which is a reference.
 */
{code}
Also do we need this setQuota in test?
{code}
    fs.setQuota(new Path(dir), 100L, HdfsConstants.QUOTA_DONT_SET);
{code}


> Concat on INodeRefernce fails with illegal state exception
> ----------------------------------------------------------
>
>                 Key: HDFS-15276
>                 URL: https://issues.apache.org/jira/browse/HDFS-15276
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: hemanthboyina
>            Assignee: hemanthboyina
>            Priority: Critical
>         Attachments: HDFS-15276.001.patch
>
>
> Performing concat operation on INodeRefernce throwing illegal state exception
> On verifySrcFiles , the src inode was getting converted to Inodefile 
> {code:java}
> final INode srcINode = iip.getLastINode();
> final INodeFile srcINodeFile = INodeFile.valueOf(srcINode, src);{code}
> If this INode is an INodeRefernce , it fails at Preconditions.checkstate as 
> the child is an refernce but we have converted that as file
> {code:java}
> INodeDirectory#removeChild
>   final INode removed = children.remove(i);
>   Preconditions.checkState(removed == child); {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to