[ https://issues.apache.org/jira/browse/HDFS-10316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255850#comment-15255850 ]
Lin Yiqun commented on HDFS-10316: ---------------------------------- Hi, [~walter.k.su], it's a good catch! I looked the code and it's right that {{countNodes(blk).corruptReplicas()}} only checking for {{NORMAL}},{{READ_ONLY}} two types in method {{BlockManager#checkReplicaOnStorage}}, while it does not check for these two cases in {{BlockManager#findAndMarkBlockAsCorrupt}}. Attach a patch from me, what do you think of this? > revisit corrupt replicas count > ------------------------------ > > Key: HDFS-10316 > URL: https://issues.apache.org/jira/browse/HDFS-10316 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Walter Su > Attachments: HDFS-10316.001.patch > > > A DN has 4 types of storages: > 1. NORMAL > 2. READ_ONLY > 3. FAILED > 4. (missing/pruned) > blocksMap.numNodes(blk) counts 1,2,3 > blocksMap.getStorages(blk) counts 1,2,3 > countNodes(blk).corruptReplicas() counts 1,2 > corruptReplicas counts 1,2,3,4. Because findAndMarkBlockAsCorrupt(..) > supports adding blk to the map even if the storage is not found. > The inconsistency causes bugs like HDFS-9958. -- This message was sent by Atlassian JIRA (v6.3.4#6332)