HDFS-6860. BlockStateChange logs are too noisy. Contributed by Chang Li and Xiaoyu Yao.
This commit is contained in:
parent
454da959c7
commit
d311a38a6b
|
@ -768,6 +768,8 @@ Release 2.8.0 - UNRELEASED
|
||||||
HDFS-7192. DN should ignore lazyPersist hint if the writer is
|
HDFS-7192. DN should ignore lazyPersist hint if the writer is
|
||||||
not local. (Arpit Agarwal)
|
not local. (Arpit Agarwal)
|
||||||
|
|
||||||
|
HDFS-6860. BlockStateChange logs are too noisy. (Chang Li and xyao via xyao)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
|
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
package org.apache.hadoop.hdfs.server.blockmanagement;
|
package org.apache.hadoop.hdfs.server.blockmanagement;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -237,7 +236,7 @@ public abstract class BlockInfoUnderConstruction extends BlockInfo {
|
||||||
for (ReplicaUnderConstruction r : replicas) {
|
for (ReplicaUnderConstruction r : replicas) {
|
||||||
if (genStamp != r.getGenerationStamp()) {
|
if (genStamp != r.getGenerationStamp()) {
|
||||||
r.getExpectedStorageLocation().removeBlock(this);
|
r.getExpectedStorageLocation().removeBlock(this);
|
||||||
NameNode.blockStateChangeLog.info("BLOCK* Removing stale replica "
|
NameNode.blockStateChangeLog.debug("BLOCK* Removing stale replica "
|
||||||
+ "from location: {}", r.getExpectedStorageLocation());
|
+ "from location: {}", r.getExpectedStorageLocation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,7 +309,7 @@ public abstract class BlockInfoUnderConstruction extends BlockInfo {
|
||||||
primary.getExpectedStorageLocation().
|
primary.getExpectedStorageLocation().
|
||||||
getDatanodeDescriptor().addBlockToBeRecovered(this);
|
getDatanodeDescriptor().addBlockToBeRecovered(this);
|
||||||
primary.setChosenAsPrimary(true);
|
primary.setChosenAsPrimary(true);
|
||||||
NameNode.blockStateChangeLog.info(
|
NameNode.blockStateChangeLog.debug(
|
||||||
"BLOCK* {} recovery started, primary={}", this, primary);
|
"BLOCK* {} recovery started, primary={}", this, primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1151,7 +1151,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
datanodes.append(node).append(" ");
|
datanodes.append(node).append(" ");
|
||||||
}
|
}
|
||||||
if (datanodes.length() != 0) {
|
if (datanodes.length() != 0) {
|
||||||
blockLog.info("BLOCK* addToInvalidates: {} {}", storedBlock,
|
blockLog.debug("BLOCK* addToInvalidates: {} {}", storedBlock,
|
||||||
datanodes.toString());
|
datanodes.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1186,7 +1186,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
// ignore the request for now. This could happen when BlockScanner
|
// ignore the request for now. This could happen when BlockScanner
|
||||||
// thread of Datanode reports bad block before Block reports are sent
|
// thread of Datanode reports bad block before Block reports are sent
|
||||||
// by the Datanode on startup
|
// by the Datanode on startup
|
||||||
blockLog.info("BLOCK* findAndMarkBlockAsCorrupt: {} not found", blk);
|
blockLog.debug("BLOCK* findAndMarkBlockAsCorrupt: {} not found", blk);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1214,7 +1214,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
DatanodeDescriptor node) throws IOException {
|
DatanodeDescriptor node) throws IOException {
|
||||||
|
|
||||||
if (b.stored.isDeleted()) {
|
if (b.stored.isDeleted()) {
|
||||||
blockLog.info("BLOCK markBlockAsCorrupt: {} cannot be marked as" +
|
blockLog.debug("BLOCK markBlockAsCorrupt: {} cannot be marked as" +
|
||||||
" corrupt as it does not belong to any file", b);
|
" corrupt as it does not belong to any file", b);
|
||||||
addToInvalidates(b.corrupted, node);
|
addToInvalidates(b.corrupted, node);
|
||||||
return;
|
return;
|
||||||
|
@ -1264,7 +1264,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
*/
|
*/
|
||||||
private boolean invalidateBlock(BlockToMarkCorrupt b, DatanodeInfo dn
|
private boolean invalidateBlock(BlockToMarkCorrupt b, DatanodeInfo dn
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
blockLog.info("BLOCK* invalidateBlock: {} on {}", b, dn);
|
blockLog.debug("BLOCK* invalidateBlock: {} on {}", b, dn);
|
||||||
DatanodeDescriptor node = getDatanodeManager().getDatanode(dn);
|
DatanodeDescriptor node = getDatanodeManager().getDatanode(dn);
|
||||||
if (node == null) {
|
if (node == null) {
|
||||||
throw new IOException("Cannot invalidate " + b
|
throw new IOException("Cannot invalidate " + b
|
||||||
|
@ -1274,7 +1274,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
// Check how many copies we have of the block
|
// Check how many copies we have of the block
|
||||||
NumberReplicas nr = countNodes(b.stored);
|
NumberReplicas nr = countNodes(b.stored);
|
||||||
if (nr.replicasOnStaleNodes() > 0) {
|
if (nr.replicasOnStaleNodes() > 0) {
|
||||||
blockLog.info("BLOCK* invalidateBlocks: postponing " +
|
blockLog.debug("BLOCK* invalidateBlocks: postponing " +
|
||||||
"invalidation of {} on {} because {} replica(s) are located on " +
|
"invalidation of {} on {} because {} replica(s) are located on " +
|
||||||
"nodes with potentially out-of-date block reports", b, dn,
|
"nodes with potentially out-of-date block reports", b, dn,
|
||||||
nr.replicasOnStaleNodes());
|
nr.replicasOnStaleNodes());
|
||||||
|
@ -1288,7 +1288,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
b, dn);
|
b, dn);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
blockLog.info("BLOCK* invalidateBlocks: {} on {} is the only copy and" +
|
blockLog.debug("BLOCK* invalidateBlocks: {} on {} is the only copy and" +
|
||||||
" was not deleted", b, dn);
|
" was not deleted", b, dn);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1421,7 +1421,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
if ( (pendingReplications.getNumReplicas(block) > 0) ||
|
if ( (pendingReplications.getNumReplicas(block) > 0) ||
|
||||||
(blockHasEnoughRacks(block, requiredReplication)) ) {
|
(blockHasEnoughRacks(block, requiredReplication)) ) {
|
||||||
neededReplications.remove(block, priority); // remove from neededReplications
|
neededReplications.remove(block, priority); // remove from neededReplications
|
||||||
blockLog.info("BLOCK* Removing {} from neededReplications as" +
|
blockLog.debug("BLOCK* Removing {} from neededReplications as" +
|
||||||
" it has enough replicas", block);
|
" it has enough replicas", block);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1491,7 +1491,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
(blockHasEnoughRacks(block, requiredReplication)) ) {
|
(blockHasEnoughRacks(block, requiredReplication)) ) {
|
||||||
neededReplications.remove(block, priority); // remove from neededReplications
|
neededReplications.remove(block, priority); // remove from neededReplications
|
||||||
rw.targets = null;
|
rw.targets = null;
|
||||||
blockLog.info("BLOCK* Removing {} from neededReplications as" +
|
blockLog.debug("BLOCK* Removing {} from neededReplications as" +
|
||||||
" it has enough replicas", block);
|
" it has enough replicas", block);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1539,7 +1539,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
targetList.append(' ');
|
targetList.append(' ');
|
||||||
targetList.append(targets[k].getDatanodeDescriptor());
|
targetList.append(targets[k].getDatanodeDescriptor());
|
||||||
}
|
}
|
||||||
blockLog.info("BLOCK* ask {} to replicate {} to {}", rw.srcNode,
|
blockLog.debug("BLOCK* ask {} to replicate {} to {}", rw.srcNode,
|
||||||
rw.block, targetList);
|
rw.block, targetList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2141,7 +2141,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isCorrupt) {
|
if (isCorrupt) {
|
||||||
blockLog.info("BLOCK* markBlockReplicasAsCorrupt: mark block replica" +
|
blockLog.debug("BLOCK* markBlockReplicasAsCorrupt: mark block replica" +
|
||||||
" {} on {} as corrupt because the dn is not in the new committed " +
|
" {} on {} as corrupt because the dn is not in the new committed " +
|
||||||
"storage list.", b, storage.getDatanodeDescriptor());
|
"storage list.", b, storage.getDatanodeDescriptor());
|
||||||
markBlockAsCorrupt(b, storage, storage.getDatanodeDescriptor());
|
markBlockAsCorrupt(b, storage, storage.getDatanodeDescriptor());
|
||||||
|
@ -2636,7 +2636,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
}
|
}
|
||||||
if (storedBlock == null || storedBlock.isDeleted()) {
|
if (storedBlock == null || storedBlock.isDeleted()) {
|
||||||
// If this block does not belong to anyfile, then we are done.
|
// If this block does not belong to anyfile, then we are done.
|
||||||
blockLog.info("BLOCK* addStoredBlock: {} on {} size {} but it does not" +
|
blockLog.debug("BLOCK* addStoredBlock: {} on {} size {} but it does not" +
|
||||||
" belong to any file", block, node, block.getNumBytes());
|
" belong to any file", block, node, block.getNumBytes());
|
||||||
|
|
||||||
// we could add this block to invalidate set of this datanode.
|
// we could add this block to invalidate set of this datanode.
|
||||||
|
@ -2726,10 +2726,10 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
|
|
||||||
private void logAddStoredBlock(BlockInfo storedBlock,
|
private void logAddStoredBlock(BlockInfo storedBlock,
|
||||||
DatanodeDescriptor node) {
|
DatanodeDescriptor node) {
|
||||||
if (!blockLog.isInfoEnabled()) {
|
if (!blockLog.isDebugEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(500);
|
StringBuilder sb = new StringBuilder(500);
|
||||||
sb.append("BLOCK* addStoredBlock: blockMap updated: ")
|
sb.append("BLOCK* addStoredBlock: blockMap updated: ")
|
||||||
.append(node)
|
.append(node)
|
||||||
|
@ -2737,7 +2737,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
storedBlock.appendStringTo(sb);
|
storedBlock.appendStringTo(sb);
|
||||||
sb.append(" size " )
|
sb.append(" size " )
|
||||||
.append(storedBlock.getNumBytes());
|
.append(storedBlock.getNumBytes());
|
||||||
blockLog.info(sb.toString());
|
blockLog.debug(sb.toString());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Invalidate corrupt replicas.
|
* Invalidate corrupt replicas.
|
||||||
|
@ -2767,7 +2767,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
removedFromBlocksMap = false;
|
removedFromBlocksMap = false;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
blockLog.info("invalidateCorruptReplicas error in deleting bad block"
|
blockLog.debug("invalidateCorruptReplicas error in deleting bad block"
|
||||||
+ " {} on {}", blk, node, e);
|
+ " {} on {}", blk, node, e);
|
||||||
removedFromBlocksMap = false;
|
removedFromBlocksMap = false;
|
||||||
}
|
}
|
||||||
|
@ -3106,7 +3106,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
// upon giving instructions to the datanodes.
|
// upon giving instructions to the datanodes.
|
||||||
//
|
//
|
||||||
addToInvalidates(storedBlock, chosen.getDatanodeDescriptor());
|
addToInvalidates(storedBlock, chosen.getDatanodeDescriptor());
|
||||||
blockLog.info("BLOCK* chooseExcessReplicates: "
|
blockLog.debug("BLOCK* chooseExcessReplicates: "
|
||||||
+"({}, {}) is added to invalidated blocks set", chosen, storedBlock);
|
+"({}, {}) is added to invalidated blocks set", chosen, storedBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3304,11 +3304,11 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
numBlocksLogged++;
|
numBlocksLogged++;
|
||||||
}
|
}
|
||||||
if (numBlocksLogged > maxNumBlocksToLog) {
|
if (numBlocksLogged > maxNumBlocksToLog) {
|
||||||
blockLog.info("BLOCK* addBlock: logged info for {} of {} reported.",
|
blockLog.debug("BLOCK* addBlock: logged info for {} of {} reported.",
|
||||||
maxNumBlocksToLog, numBlocksLogged);
|
maxNumBlocksToLog, numBlocksLogged);
|
||||||
}
|
}
|
||||||
for (Block b : toInvalidate) {
|
for (Block b : toInvalidate) {
|
||||||
blockLog.info("BLOCK* addBlock: block {} on node {} size {} does not " +
|
blockLog.debug("BLOCK* addBlock: block {} on node {} size {} does not " +
|
||||||
"belong to any file", b, node, b.getNumBytes());
|
"belong to any file", b, node, b.getNumBytes());
|
||||||
addToInvalidates(b, node);
|
addToInvalidates(b, node);
|
||||||
}
|
}
|
||||||
|
@ -3654,7 +3654,7 @@ public class BlockManager implements BlockStatsMXBean {
|
||||||
} finally {
|
} finally {
|
||||||
namesystem.writeUnlock();
|
namesystem.writeUnlock();
|
||||||
}
|
}
|
||||||
blockLog.info("BLOCK* {}: ask {} to delete {}", getClass().getSimpleName(),
|
blockLog.debug("BLOCK* {}: ask {} to delete {}", getClass().getSimpleName(),
|
||||||
dn, toInvalidate);
|
dn, toInvalidate);
|
||||||
return toInvalidate.size();
|
return toInvalidate.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,12 +80,12 @@ public class CorruptReplicasMap{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nodes.keySet().contains(dn)) {
|
if (!nodes.keySet().contains(dn)) {
|
||||||
NameNode.blockStateChangeLog.info(
|
NameNode.blockStateChangeLog.debug(
|
||||||
"BLOCK NameSystem.addToCorruptReplicasMap: {} added as corrupt on "
|
"BLOCK NameSystem.addToCorruptReplicasMap: {} added as corrupt on "
|
||||||
+ "{} by {} {}", blk.getBlockName(), dn, Server.getRemoteIp(),
|
+ "{} by {} {}", blk.getBlockName(), dn, Server.getRemoteIp(),
|
||||||
reasonText);
|
reasonText);
|
||||||
} else {
|
} else {
|
||||||
NameNode.blockStateChangeLog.info(
|
NameNode.blockStateChangeLog.debug(
|
||||||
"BLOCK NameSystem.addToCorruptReplicasMap: duplicate requested for" +
|
"BLOCK NameSystem.addToCorruptReplicasMap: duplicate requested for" +
|
||||||
" {} to add as corrupt on {} by {} {}", blk.getBlockName(), dn,
|
" {} to add as corrupt on {} by {} {}", blk.getBlockName(), dn,
|
||||||
Server.getRemoteIp(), reasonText);
|
Server.getRemoteIp(), reasonText);
|
||||||
|
|
|
@ -113,7 +113,7 @@ class InvalidateBlocks {
|
||||||
if (set.add(block)) {
|
if (set.add(block)) {
|
||||||
numBlocks++;
|
numBlocks++;
|
||||||
if (log) {
|
if (log) {
|
||||||
NameNode.blockStateChangeLog.info("BLOCK* {}: add {} to {}",
|
NameNode.blockStateChangeLog.debug("BLOCK* {}: add {} to {}",
|
||||||
getClass().getSimpleName(), block, datanode);
|
getClass().getSimpleName(), block, datanode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue