Repository: hadoop
Updated Branches:
  refs/heads/branch-2 d49074f0a -> 82530c966
  refs/heads/branch-2.7 53a72f634 -> 02f6030b3
  refs/heads/branch-2.8 f043aa953 -> 834226ba2
  refs/heads/branch-2.9 050aa531b -> 41d434d08
  refs/heads/branch-3.0 38febc0ae -> 41cf2b8e7


HDFS-10453. ReplicationMonitor thread could stuck for long time due to the race 
between replication and delete of same file in a large cluster.. Contributed by 
He Xiaoqiao.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/82530c96
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/82530c96
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/82530c96

Branch: refs/heads/branch-2
Commit: 82530c966a0413d310f702182e7aacd959d64f06
Parents: d49074f
Author: Arpit Agarwal <a...@apache.org>
Authored: Mon Feb 12 07:02:42 2018 -0800
Committer: Arpit Agarwal <a...@apache.org>
Committed: Mon Feb 12 07:02:42 2018 -0800

----------------------------------------------------------------------
 .../hadoop/hdfs/server/blockmanagement/ReplicationWork.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/82530c96/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/ReplicationWork.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/ReplicationWork.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/ReplicationWork.java
index 8362096..aaf509e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/ReplicationWork.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/ReplicationWork.java
@@ -26,6 +26,7 @@ import java.util.Set;
 class ReplicationWork {
   private final BlockInfo block;
   private final String srcPath;
+  private final long blockSize;
   private final byte storagePolicyID;
   private final DatanodeDescriptor srcNode;
   private final int additionalReplRequired;
@@ -40,6 +41,7 @@ class ReplicationWork {
       int priority) {
     this.block = block;
     this.srcPath = bc.getName();
+    this.blockSize = block.getNumBytes();
     this.storagePolicyID = bc.getStoragePolicyID();
     this.srcNode = srcNode;
     this.srcNode.incrementPendingReplicationWithoutTargets();
@@ -56,7 +58,7 @@ class ReplicationWork {
     try {
       targets = blockplacement.chooseTarget(getSrcPath(),
           additionalReplRequired, srcNode, liveReplicaStorages, false,
-          excludedNodes, block.getNumBytes(),
+          excludedNodes, blockSize,
           storagePolicySuite.getPolicy(getStoragePolicyID()), null);
     } finally {
       srcNode.decrementPendingReplicationWithoutTargets();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to