hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "He Xiaoqiao (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-9334) NameNode crash caused by ArrayIndexOutOfBoundsException
Date Thu, 29 Oct 2015 03:06:27 GMT
He Xiaoqiao created HDFS-9334:
---------------------------------

             Summary: 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)

Mime
View raw message