HDFS-10347. Namenode report bad block method doesn't log the bad block or datanode. Contributed by Rushabh Shah.

(cherry picked from commit 7da540d03e)
This commit is contained in:
Kihwal Lee 2016-04-29 15:58:45 -05:00
parent 3222dea8ed
commit e9cd88d484
1 changed files with 2 additions and 1 deletions

View File

@ -5442,7 +5442,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
*/
void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
checkOperation(OperationCategory.WRITE);
NameNode.stateChangeLog.info("*DIR* reportBadBlocks");
writeLock();
try {
checkOperation(OperationCategory.WRITE);
@ -5451,6 +5450,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
DatanodeInfo[] nodes = blocks[i].getLocations();
String[] storageIDs = blocks[i].getStorageIDs();
for (int j = 0; j < nodes.length; j++) {
NameNode.stateChangeLog.info("*DIR* reportBadBlocks for block: {} on"
+ " datanode: {}", blk, nodes[j].getXferAddr());
blockManager.findAndMarkBlockAsCorrupt(blk, nodes[j],
storageIDs == null ? null: storageIDs[j],
"client machine reported it");