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

Xiao Chen commented on HDFS-9313:
---------------------------------

As [discussed in 
HDFS-8647|https://issues.apache.org/jira/browse/HDFS-8647?focusedCommentId=15032747&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15032747],
 I'm providing branch2.6/2.7 patch for this JIRA.
Cherry-picking from branch2, the backport was clean. But I had to fix a compile 
error about {{HdfsServerConstants}} due to file change. Additionally I removed 
the logging change, in order for the code to run. (Otherwise error at run time: 
(java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast 
to org.apache.commons.logging.impl.Log4JLogger)).
Locally tested both patches compile and passes TestReplicationPolicy.

> Possible NullPointerException in BlockManager if no excess replica can be 
> chosen
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-9313
>                 URL: https://issues.apache.org/jira/browse/HDFS-9313
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ming Ma
>            Assignee: Ming Ma
>             Fix For: 2.8.0
>
>         Attachments: HDFS-9313-2.patch, HDFS-9313.branch26.patch, 
> HDFS-9313.branch27.patch, HDFS-9313.patch
>
>
> HDFS-8647 makes it easier to reason about various block placement scenarios. 
> Here is one possible case where BlockManager won't be able to find the excess 
> replica to delete: when storage policy changes around the same time balancer 
> moves the block. When this happens, it will cause NullPointerException.
> {noformat}
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicy.adjustSetsWithChosenReplica(BlockPlacementPolicy.java:156)
>       at 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseReplicasToDelete(BlockPlacementPolicyDefault.java:978)
> {noformat}
> Note that it isn't found in any production clusters. Instead, it is found 
> from new unit tests. In addition, the issue has been there before HDFS-8647.



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

Reply via email to