[
https://issues.apache.org/jira/browse/HDFS-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104804#comment-13104804
]
Benoy Antony commented on HDFS-2290:
------------------------------------
There is a bug in BlockManager (NameNode) which prevents the namenode from
adding the corrupt block to the list of blocks of be invalidated.
The following snippet is from BlockManager.markBlockAsCorrupt ()
if (countNodes(storedBlock).liveReplicas() > inode.getReplication()) {
// the block is over-replicated so invalidate the replicas immediately
invalidateBlock(storedBlock, node);
} else {
// add the block to neededReplication
updateNeededReplications(storedBlock, -1, 0);
}
If the replication factor for the file is 2 and the number of good replicas is
2, the above condition still will NOT invalidate the block. This condition
should be changed to
if (countNodes(storedBlock).liveReplicas() >= inode.getReplication()) {
> Block with corrupt replica is not getting replicated
> ----------------------------------------------------
>
> Key: HDFS-2290
> URL: https://issues.apache.org/jira/browse/HDFS-2290
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 0.22.0
> Reporter: Konstantin Shvachko
> Priority: Blocker
> Fix For: 0.22.0
>
>
> A block has one replica marked as corrupt and two good ones. countNodes()
> correctly detects that there are only 2 live replicas, and fsck reports the
> block as under-replicated. But ReplicationMonitor never schedules replication
> of good replicas.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira