HDFS-16870 HDFS client ip should also be logged when NameNode is processing reportBadBlocks
This commit is contained in:
parent
ca3526da92
commit
05137dd0ff
|
@ -5884,6 +5884,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
*/
|
||||
void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
InetAddress remoteIp = Server.getRemoteIp();
|
||||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
|
@ -5893,7 +5894,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
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());
|
||||
+ " datanode: {}" + " client: {}", blk, nodes[j].getXferAddr(), remoteIp);
|
||||
blockManager.findAndMarkBlockAsCorrupt(blk, nodes[j],
|
||||
storageIDs == null ? null: storageIDs[j],
|
||||
"client machine reported it");
|
||||
|
|
Loading…
Reference in New Issue