|
@@ -950,8 +950,8 @@ public class BlockManager {
|
|
datanodes.append(node).append(" ");
|
|
datanodes.append(node).append(" ");
|
|
}
|
|
}
|
|
if (datanodes.length() != 0) {
|
|
if (datanodes.length() != 0) {
|
|
- NameNode.stateChangeLog.info("BLOCK* addToInvalidates: "
|
|
|
|
- + b + " to " + datanodes.toString());
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("BLOCK* addToInvalidates: " + b + " "
|
|
|
|
+ + datanodes);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -972,7 +972,7 @@ public class BlockManager {
|
|
// 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
|
|
NameNode.stateChangeLog.info("BLOCK* findAndMarkBlockAsCorrupt: "
|
|
NameNode.stateChangeLog.info("BLOCK* findAndMarkBlockAsCorrupt: "
|
|
- + blk + " not found.");
|
|
|
|
|
|
+ + blk + " not found");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
markBlockAsCorrupt(new BlockToMarkCorrupt(storedBlock, reason), dn);
|
|
markBlockAsCorrupt(new BlockToMarkCorrupt(storedBlock, reason), dn);
|
|
@@ -1026,7 +1026,7 @@ public class BlockManager {
|
|
NameNode.stateChangeLog.info("BLOCK* invalidateBlocks: postponing " +
|
|
NameNode.stateChangeLog.info("BLOCK* invalidateBlocks: postponing " +
|
|
"invalidation of " + b + " on " + dn + " because " +
|
|
"invalidation of " + b + " on " + dn + " because " +
|
|
nr.replicasOnStaleNodes() + " replica(s) are located on nodes " +
|
|
nr.replicasOnStaleNodes() + " replica(s) are located on nodes " +
|
|
- "with potentially out-of-date block reports.");
|
|
|
|
|
|
+ "with potentially out-of-date block reports");
|
|
postponeBlock(b.corrupted);
|
|
postponeBlock(b.corrupted);
|
|
|
|
|
|
} else if (nr.liveReplicas() >= 1) {
|
|
} else if (nr.liveReplicas() >= 1) {
|
|
@@ -1039,7 +1039,7 @@ public class BlockManager {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
NameNode.stateChangeLog.info("BLOCK* invalidateBlocks: " + b
|
|
NameNode.stateChangeLog.info("BLOCK* invalidateBlocks: " + b
|
|
- + " on " + dn + " is the only copy and was not deleted.");
|
|
|
|
|
|
+ + " on " + dn + " is the only copy and was not deleted");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1160,9 +1160,8 @@ public class BlockManager {
|
|
(blockHasEnoughRacks(block)) ) {
|
|
(blockHasEnoughRacks(block)) ) {
|
|
neededReplications.remove(block, priority); // remove from neededReplications
|
|
neededReplications.remove(block, priority); // remove from neededReplications
|
|
neededReplications.decrementReplicationIndex(priority);
|
|
neededReplications.decrementReplicationIndex(priority);
|
|
- NameNode.stateChangeLog.info("BLOCK* "
|
|
|
|
- + "Removing block " + block
|
|
|
|
- + " from neededReplications as it has enough replicas.");
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("BLOCK* Removing " + block
|
|
|
|
+ + " from neededReplications as it has enough replicas");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1236,9 +1235,8 @@ public class BlockManager {
|
|
neededReplications.remove(block, priority); // remove from neededReplications
|
|
neededReplications.remove(block, priority); // remove from neededReplications
|
|
neededReplications.decrementReplicationIndex(priority);
|
|
neededReplications.decrementReplicationIndex(priority);
|
|
rw.targets = null;
|
|
rw.targets = null;
|
|
- NameNode.stateChangeLog.info("BLOCK* "
|
|
|
|
- + "Removing block " + block
|
|
|
|
- + " from neededReplications as it has enough replicas.");
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("BLOCK* Removing " + block
|
|
|
|
+ + " from neededReplications as it has enough replicas");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1290,10 +1288,8 @@ public class BlockManager {
|
|
targetList.append(' ');
|
|
targetList.append(' ');
|
|
targetList.append(targets[k]);
|
|
targetList.append(targets[k]);
|
|
}
|
|
}
|
|
- NameNode.stateChangeLog.info(
|
|
|
|
- "BLOCK* ask "
|
|
|
|
- + rw.srcNode + " to replicate "
|
|
|
|
- + rw.block + " to " + targetList);
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("BLOCK* ask " + rw.srcNode
|
|
|
|
+ + " to replicate " + rw.block + " to " + targetList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1527,10 +1523,9 @@ public class BlockManager {
|
|
boolean staleBefore = node.areBlockContentsStale();
|
|
boolean staleBefore = node.areBlockContentsStale();
|
|
node.receivedBlockReport();
|
|
node.receivedBlockReport();
|
|
if (staleBefore && !node.areBlockContentsStale()) {
|
|
if (staleBefore && !node.areBlockContentsStale()) {
|
|
- LOG.info("BLOCK* processReport: " +
|
|
|
|
- "Received first block report from " + node +
|
|
|
|
- " after becoming active. Its block contents are no longer" +
|
|
|
|
- " considered stale.");
|
|
|
|
|
|
+ LOG.info("BLOCK* processReport: Received first block report from "
|
|
|
|
+ + node + " after becoming active. Its block contents are no longer"
|
|
|
|
+ + " considered stale");
|
|
rescanPostponedMisreplicatedBlocks();
|
|
rescanPostponedMisreplicatedBlocks();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1601,9 +1596,9 @@ public class BlockManager {
|
|
addStoredBlock(b, node, null, true);
|
|
addStoredBlock(b, node, null, true);
|
|
}
|
|
}
|
|
for (Block b : toInvalidate) {
|
|
for (Block b : toInvalidate) {
|
|
- NameNode.stateChangeLog.info("BLOCK* processReport: block "
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("BLOCK* processReport: "
|
|
+ b + " on " + node + " size " + b.getNumBytes()
|
|
+ b + " on " + node + " size " + b.getNumBytes()
|
|
- + " does not belong to any file.");
|
|
|
|
|
|
+ + " does not belong to any file");
|
|
addToInvalidates(b, node);
|
|
addToInvalidates(b, node);
|
|
}
|
|
}
|
|
for (BlockToMarkCorrupt b : toCorrupt) {
|
|
for (BlockToMarkCorrupt b : toCorrupt) {
|
|
@@ -1870,7 +1865,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
int count = pendingDNMessages.count();
|
|
int count = pendingDNMessages.count();
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
LOG.info("Processing " + count + " messages from DataNodes " +
|
|
LOG.info("Processing " + count + " messages from DataNodes " +
|
|
- "that were previously queued during standby state.");
|
|
|
|
|
|
+ "that were previously queued during standby state");
|
|
}
|
|
}
|
|
processQueuedMessages(pendingDNMessages.takeAll());
|
|
processQueuedMessages(pendingDNMessages.takeAll());
|
|
assert pendingDNMessages.count() == 0;
|
|
assert pendingDNMessages.count() == 0;
|
|
@@ -1927,9 +1922,9 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
// the block report got a little bit delayed after the pipeline
|
|
// the block report got a little bit delayed after the pipeline
|
|
// closed. So, ignore this report, assuming we will get a
|
|
// closed. So, ignore this report, assuming we will get a
|
|
// FINALIZED replica later. See HDFS-2791
|
|
// FINALIZED replica later. See HDFS-2791
|
|
- LOG.info("Received an RBW replica for block " + storedBlock +
|
|
|
|
- " on " + dn + ": ignoring it, since the block is " +
|
|
|
|
- "complete with the same generation stamp.");
|
|
|
|
|
|
+ LOG.info("Received an RBW replica for " + storedBlock +
|
|
|
|
+ " on " + dn + ": ignoring it, since it is " +
|
|
|
|
+ "complete with the same genstamp");
|
|
return null;
|
|
return null;
|
|
} else {
|
|
} else {
|
|
return new BlockToMarkCorrupt(storedBlock,
|
|
return new BlockToMarkCorrupt(storedBlock,
|
|
@@ -2041,7 +2036,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
// If this block does not belong to anyfile, then we are done.
|
|
// If this block does not belong to anyfile, then we are done.
|
|
NameNode.stateChangeLog.info("BLOCK* addStoredBlock: " + block + " on "
|
|
NameNode.stateChangeLog.info("BLOCK* addStoredBlock: " + block + " on "
|
|
+ node + " size " + block.getNumBytes()
|
|
+ node + " size " + block.getNumBytes()
|
|
- + " but it does not belong to any file.");
|
|
|
|
|
|
+ + " but it does not belong to any file");
|
|
// we could add this block to invalidate set of this datanode.
|
|
// we could add this block to invalidate set of this datanode.
|
|
// it will happen in next block report otherwise.
|
|
// it will happen in next block report otherwise.
|
|
return block;
|
|
return block;
|
|
@@ -2158,9 +2153,8 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
try {
|
|
try {
|
|
invalidateBlock(new BlockToMarkCorrupt(blk, null), node);
|
|
invalidateBlock(new BlockToMarkCorrupt(blk, null), node);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- NameNode.stateChangeLog.info("NameNode.invalidateCorruptReplicas " +
|
|
|
|
- "error in deleting bad block " + blk +
|
|
|
|
- " on " + node, e);
|
|
|
|
|
|
+ NameNode.stateChangeLog.info("invalidateCorruptReplicas "
|
|
|
|
+ + "error in deleting bad block " + blk + " on " + node, e);
|
|
gotException = true;
|
|
gotException = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2308,7 +2302,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
DatanodeDescriptor cur = it.next();
|
|
DatanodeDescriptor cur = it.next();
|
|
if (cur.areBlockContentsStale()) {
|
|
if (cur.areBlockContentsStale()) {
|
|
LOG.info("BLOCK* processOverReplicatedBlock: " +
|
|
LOG.info("BLOCK* processOverReplicatedBlock: " +
|
|
- "Postponing processing of over-replicated block " +
|
|
|
|
|
|
+ "Postponing processing of over-replicated " +
|
|
block + " since datanode " + cur + " does not yet have up-to-date " +
|
|
block + " since datanode " + cur + " does not yet have up-to-date " +
|
|
"block information.");
|
|
"block information.");
|
|
postponeBlock(block);
|
|
postponeBlock(block);
|
|
@@ -2398,7 +2392,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
//
|
|
//
|
|
addToInvalidates(b, cur);
|
|
addToInvalidates(b, cur);
|
|
NameNode.stateChangeLog.info("BLOCK* chooseExcessReplicates: "
|
|
NameNode.stateChangeLog.info("BLOCK* chooseExcessReplicates: "
|
|
- +"("+cur+", "+b+") is added to invalidated blocks set.");
|
|
|
|
|
|
+ +"("+cur+", "+b+") is added to invalidated blocks set");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2540,7 +2534,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
for (Block b : toInvalidate) {
|
|
for (Block b : toInvalidate) {
|
|
NameNode.stateChangeLog.info("BLOCK* addBlock: block "
|
|
NameNode.stateChangeLog.info("BLOCK* addBlock: block "
|
|
+ b + " on " + node + " size " + b.getNumBytes()
|
|
+ b + " on " + node + " size " + b.getNumBytes()
|
|
- + " does not belong to any file.");
|
|
|
|
|
|
+ + " does not belong to any file");
|
|
addToInvalidates(b, node);
|
|
addToInvalidates(b, node);
|
|
}
|
|
}
|
|
for (BlockToMarkCorrupt b : toCorrupt) {
|
|
for (BlockToMarkCorrupt b : toCorrupt) {
|
|
@@ -2651,7 +2645,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|
* of live nodes. If in startup safemode (or its 30-sec extension period),
|
|
* of live nodes. If in startup safemode (or its 30-sec extension period),
|
|
* then it gains speed by ignoring issues of excess replicas or nodes
|
|
* then it gains speed by ignoring issues of excess replicas or nodes
|
|
* that are decommissioned or in process of becoming decommissioned.
|
|
* that are decommissioned or in process of becoming decommissioned.
|
|
- * If not in startup, then it calls {@link countNodes()} instead.
|
|
|
|
|
|
+ * If not in startup, then it calls {@link #countNodes(Block)} instead.
|
|
*
|
|
*
|
|
* @param b - the block being tested
|
|
* @param b - the block being tested
|
|
* @return count of live nodes for this block
|
|
* @return count of live nodes for this block
|