Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8E08F200D61 for ; Tue, 5 Dec 2017 02:04:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8C8DE160C1B; Tue, 5 Dec 2017 01:04:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D1667160BF9 for ; Tue, 5 Dec 2017 02:04:10 +0100 (CET) Received: (qmail 90841 invoked by uid 500); 5 Dec 2017 01:04:09 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 90832 invoked by uid 99); 5 Dec 2017 01:04:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2017 01:04:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BAE76F6104; Tue, 5 Dec 2017 01:04:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: junping_du@apache.org To: common-commits@hadoop.apache.org Date: Tue, 05 Dec 2017 01:04:08 -0000 Message-Id: <318761b1f2544b1daed16f7988339aed@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] hadoop git commit: HDFS-12832. INode.getFullPathName may throw ArrayIndexOutOfBoundsException lead to NameNode exit. Contribuited by Konstantin Shvachko. archived-at: Tue, 05 Dec 2017 01:04:11 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2.8.3 f92fea391 -> b3fe56402 HDFS-12832. INode.getFullPathName may throw ArrayIndexOutOfBoundsException lead to NameNode exit. Contribuited by Konstantin Shvachko. (cherry picked from commit d331762f24b3f22f609366740c9c4f449edc61ac) (cherry picked from commit 3219b1bdf6d6a8a86ed1db1491df63a4748ad6de) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a32ae95b Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a32ae95b Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a32ae95b Branch: refs/heads/branch-2.8.3 Commit: a32ae95b0959b6536690e0510daf7ac10b230b35 Parents: f92fea3 Author: Konstantin V Shvachko Authored: Tue Nov 28 17:14:23 2017 -0800 Committer: Junping Du Committed: Mon Dec 4 17:01:02 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/a32ae95b/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 3cc66bf..e2bdfcb 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 @@ -1527,8 +1527,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/a32ae95b/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 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 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