HDFS-10347. Namenode report bad block method doesn't log the bad block or datanode. Contributed by Rushabh Shah.
This commit is contained in:
parent
26ac0f8f0b
commit
7da540d03e
@ -4798,7 +4798,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||||||
*/
|
*/
|
||||||
void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
NameNode.stateChangeLog.info("*DIR* reportBadBlocks");
|
|
||||||
writeLock();
|
writeLock();
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
@ -4807,6 +4806,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||||||
DatanodeInfo[] nodes = blocks[i].getLocations();
|
DatanodeInfo[] nodes = blocks[i].getLocations();
|
||||||
String[] storageIDs = blocks[i].getStorageIDs();
|
String[] storageIDs = blocks[i].getStorageIDs();
|
||||||
for (int j = 0; j < nodes.length; j++) {
|
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],
|
blockManager.findAndMarkBlockAsCorrupt(blk, nodes[j],
|
||||||
storageIDs == null ? null: storageIDs[j],
|
storageIDs == null ? null: storageIDs[j],
|
||||||
"client machine reported it");
|
"client machine reported it");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user