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

He Xiaoqiao commented on HDFS-9334:
-----------------------------------

the following scenario may occur ArrayIndexOutOfBoundsException:
1. more than one replica of Block located at same DN, then part circular are 
included in Double linked list,
2. delete one replica when DN hb/other,
3. delete File of Block belong to when do editlog tailer .
not find proof through log yet. 
[~walter.k.su] FYI.

> NameNode crash caused by ArrayIndexOutOfBoundsException
> -------------------------------------------------------
>
>                 Key: HDFS-9334
>                 URL: https://issues.apache.org/jira/browse/HDFS-9334
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.4.1
>            Reporter: He Xiaoqiao
>            Assignee: He Xiaoqiao
>
> when remove block from list of blocks by method {{listRemove}} in 
> {{BlockInfo.java}}, and {{findStorageInfo(storage)}} return -1 means not 
> found, {{prev.setNext(prev.findStorageInfo(storage), next)}} or 
> {{next.setPrevious(next.findStorageInfo(storage), prev)}} could throw 
> ArrayIndexOutOfBoundsException cause NameNode Process exit.
> {code:title=BlockInfo.java}
>   BlockInfo listRemove(BlockInfo head, DatanodeStorageInfo storage) {
>     if(head == null)
>       return null;
>     int dnIndex = this.findStorageInfo(storage);
>     if(dnIndex < 0) // this block is not on the data-node list
>       return head;
>     BlockInfo next = this.getNext(dnIndex);
>     BlockInfo prev = this.getPrevious(dnIndex);
>     this.setNext(dnIndex, null);
>     this.setPrevious(dnIndex, null);
>     if(prev != null)
>       prev.setNext(prev.findStorageInfo(storage), next);
>     if(next != null)
>       next.setPrevious(next.findStorageInfo(storage), prev);
>     if(this == head)  // removing the head
>       head = next;
>     return head;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to