[ https://issues.apache.org/jira/browse/HDFS-8827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14660542#comment-14660542 ]
Jing Zhao commented on HDFS-8827: --------------------------------- Thanks [~tfukudom] for further investigation and thanks Walter for the fix! The patch looks good to me. One minor: {code} // the number of target left replicas equals to the of number of the found // indices, since we want every index has one replica left. int numOfTarget = found.cardinality(); int numToDelete = nonExcess.size() - numOfTarget; // the number of expected left replicas in nonExcess. It doesn't include the // replicas belonging to the blockGroup but not in nonExcess. int numOfLeft = nonExcess.size() - numToDelete; {code} Here the numOfLeft is actually numOfTarget, also the javadoc needs to be polished. > Erasure Coding: When namenode processes over replicated striped block, NPE > will be occur in ReplicationMonitor > -------------------------------------------------------------------------------------------------------------- > > Key: HDFS-8827 > URL: https://issues.apache.org/jira/browse/HDFS-8827 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Takuya Fukudome > Assignee: Takuya Fukudome > Attachments: HDFS-8827-HDFS-7285.04.patch, HDFS-8827.1.patch, > HDFS-8827.2.patch, HDFS-8827.3.patch, processing-over-replica-npe.log > > > In our test cluster, when namenode processed over replicated striped blocks, > null pointer exception(NPE) occurred. This happened under below situation: 1) > some datanodes shutdown. 2) namenode recovers block group which lost internal > blocks. 3) restart the stopped datanodes. 4) namenode processes over > replicated striped blocks. 5) NPE occurs > I think BlockPlacementPolicyDefault#chooseReplicaToDelete will return null in > this situation which causes this NPE problem. -- This message was sent by Atlassian JIRA (v6.3.4#6332)