Repository: hadoop Updated Branches: refs/heads/branch-2.7 c8767fb68 -> e1798e8f2
Revert "HDFS-4937. ReplicationMonitor can infinite-loop in BlockPlacementPolicyDefault#chooseRandom(). Contributed by Kihwal Lee." This reverts commit c250b21c23945ce2c580186c224cc65ab2b501fc. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e1798e8f Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e1798e8f Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e1798e8f Branch: refs/heads/branch-2.7 Commit: e1798e8f2148d27fbabc45b56fa03f690f8613d2 Parents: c8767fb Author: yliu <[email protected]> Authored: Sat Oct 31 16:25:53 2015 +0800 Committer: yliu <[email protected]> Committed: Sat Oct 31 16:25:53 2015 +0800 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 --- .../blockmanagement/BlockPlacementPolicyDefault.java | 12 ------------ 2 files changed, 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e1798e8f/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 7ad45c4..8cf1bd9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -89,9 +89,6 @@ Release 2.7.2 - UNRELEASED HDFS-9317. Document fsck -blockId and -storagepolicy options in branch-2.7. (aajisaka) - HDFS-4937. ReplicationMonitor can infinite-loop in - BlockPlacementPolicyDefault#chooseRandom() (kihwal) - Release 2.7.1 - 2015-07-06 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/e1798e8f/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java index 086abca..97ea782 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java @@ -622,7 +622,6 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy { int numOfAvailableNodes = clusterMap.countNumOfAvailableNodes( scope, excludedNodes); - int refreshCounter = numOfAvailableNodes; StringBuilder builder = null; if (LOG.isDebugEnabled()) { builder = debugLoggingBuilder.get(); @@ -676,17 +675,6 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy { // If no candidate storage was found on this DN then set badTarget. badTarget = (i == storages.length); } - // Refresh the node count. If the live node count became smaller, - // but it is not reflected in this loop, it may loop forever in case - // the replicas/rack cannot be satisfied. - if (--refreshCounter == 0) { - refreshCounter = clusterMap.countNumOfAvailableNodes(scope, - excludedNodes); - // It has already gone through enough number of nodes. - if (refreshCounter <= excludedNodes.size()) { - break; - } - } } if (numOfReplicas>0) {
