hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [6/6] hadoop git commit: HDFS-12832. INode.getFullPathName may throw ArrayIndexOutOfBoundsException lead to NameNode exit. Contribuited by Konstantin Shvachko.
Date Wed, 29 Nov 2017 02:18:30 GMT
HDFS-12832. INode.getFullPathName may throw ArrayIndexOutOfBoundsException lead to NameNode
exit. Contribuited by Konstantin Shvachko.

(cherry picked from commit d331762f24b3f22f609366740c9c4f449edc61ac)


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

Branch: refs/heads/branch-2.9
Commit: 3f9f0055eba7a3b8b9f8778f27e87b2e7be15c96
Parents: 83c4075
Author: Konstantin V Shvachko <shv@apache.org>
Authored: Tue Nov 28 17:14:23 2017 -0800
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Tue Nov 28 18:11:38 2017 -0800

----------------------------------------------------------------------
 .../hdfs/server/blockmanagement/BlockManager.java |  2 --
 .../server/blockmanagement/ReplicationWork.java   | 18 ++++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3f9f0055/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
index a49cb24..bdb926c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
@@ -1592,8 +1592,6 @@ public class BlockManager implements BlockStatsMXBean {
       }
 
       // choose replication targets: NOT HOLDING THE GLOBAL LOCK
-      // It is costly to extract the filename for which chooseTargets is called,
-      // so for now we pass in the block collection itself.
       rw.chooseTargets(blockplacement, storagePolicySuite, excludedNodes);
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3f9f0055/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 258dfdd..8362096 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
@@ -25,7 +25,8 @@ import java.util.Set;
 
 class ReplicationWork {
   private final BlockInfo block;
-  private final BlockCollection bc;
+  private final String srcPath;
+  private final byte storagePolicyID;
   private final DatanodeDescriptor srcNode;
   private final int additionalReplRequired;
   private final int priority;
@@ -38,7 +39,8 @@ class ReplicationWork {
       List<DatanodeStorageInfo> liveReplicaStorages, int additionalReplRequired,
       int priority) {
     this.block = block;
-    this.bc = bc;
+    this.srcPath = bc.getName();
+    this.storagePolicyID = bc.getStoragePolicyID();
     this.srcNode = srcNode;
     this.srcNode.incrementPendingReplicationWithoutTargets();
     this.containingNodes = containingNodes;
@@ -52,10 +54,10 @@ class ReplicationWork {
       BlockStoragePolicySuite storagePolicySuite,
       Set<Node> excludedNodes) {
     try {
-      targets = blockplacement.chooseTarget(bc.getName(),
+      targets = blockplacement.chooseTarget(getSrcPath(),
           additionalReplRequired, srcNode, liveReplicaStorages, false,
           excludedNodes, block.getNumBytes(),
-          storagePolicySuite.getPolicy(bc.getStoragePolicyID()), null);
+          storagePolicySuite.getPolicy(getStoragePolicyID()), null);
     } finally {
       srcNode.decrementPendingReplicationWithoutTargets();
     }
@@ -84,4 +86,12 @@ class ReplicationWork {
   public DatanodeDescriptor getSrcNode() {
     return srcNode;
   }
+
+  public String getSrcPath() {
+    return srcPath;
+  }
+
+  public byte getStoragePolicyID() {
+    return storagePolicyID;
+  }
 }


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


Mime
View raw message