svn merge -c 1406278 FIXES: HDFS-4075. Reduce recommissioning overhead (Kihwal Lee via daryn)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1406279 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fdf831f4fb
commit
cf4a167525
|
@ -1662,6 +1662,8 @@ Release 0.23.5 - UNRELEASED
|
|||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-4075. Reduce recommissioning overhead (Kihwal Lee via daryn)
|
||||
|
||||
BUG FIXES
|
||||
|
||||
HDFS-3829. TestHftpURLTimeouts fails intermittently with JDK7 (Trevor
|
||||
|
|
|
@ -2725,6 +2725,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|||
void processOverReplicatedBlocksOnReCommission(
|
||||
final DatanodeDescriptor srcNode) {
|
||||
final Iterator<? extends Block> it = srcNode.getBlockIterator();
|
||||
int numOverReplicated = 0;
|
||||
while(it.hasNext()) {
|
||||
final Block block = it.next();
|
||||
BlockCollection bc = blocksMap.getBlockCollection(block);
|
||||
|
@ -2734,8 +2735,11 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block
|
|||
if (numCurrentReplica > expectedReplication) {
|
||||
// over-replicated block
|
||||
processOverReplicatedBlock(block, expectedReplication, null, null);
|
||||
numOverReplicated++;
|
||||
}
|
||||
}
|
||||
LOG.info("Invalidated " + numOverReplicated + " over-replicated blocks on " +
|
||||
srcNode + " during recommissioning");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -591,7 +591,11 @@ public class DatanodeManager {
|
|||
if (node.isDecommissionInProgress() || node.isDecommissioned()) {
|
||||
LOG.info("Stop Decommissioning " + node);
|
||||
heartbeatManager.stopDecommission(node);
|
||||
blockManager.processOverReplicatedBlocksOnReCommission(node);
|
||||
// Over-replicated blocks will be detected and processed when
|
||||
// the dead node comes back and send in its full block report.
|
||||
if (node.isAlive) {
|
||||
blockManager.processOverReplicatedBlocksOnReCommission(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue