fengnanli commented on a change in pull request #2388:
URL: https://github.com/apache/hadoop/pull/2388#discussion_r506070741
##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
##########
@@ -3559,9 +3558,26 @@ private Block addStoredBlock(final BlockInfo block,
if ((corruptReplicasCount > 0) && (numLiveReplicas >= fileRedundancy))
{
invalidateCorruptReplicas(storedBlock, reportedBlock, num);
}
+ if (shouldInvalidateDecommissionedRedundancy(num, fileRedundancy)) {
+ for (DatanodeStorageInfo storage : blocksMap.getStorages(block)) {
+ final DatanodeDescriptor datanode = storage.getDatanodeDescriptor();
+ if (datanode.isDecommissioned()
+ || datanode.isDecommissionInProgress()) {
+ addToInvalidates(storedBlock, datanode);
+ }
+ }
+ }
return storedBlock;
}
+ // If there are enough live replicas, start invalidating
+ // decommissioned + decommissioning replicas
+ private boolean shouldInvalidateDecommissionedRedundancy(NumberReplicas num,
Review comment:
Good idea.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
|