Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DD3617E70 for ; Thu, 8 Oct 2015 02:37:19 +0000 (UTC) Received: (qmail 51377 invoked by uid 500); 8 Oct 2015 02:37:18 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 51313 invoked by uid 500); 8 Oct 2015 02:37:18 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 51304 invoked by uid 99); 8 Oct 2015 02:37:18 -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; Thu, 08 Oct 2015 02:37:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 93D50DFE62; Thu, 8 Oct 2015 02:37:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yliu@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-9137. DeadLock between DataNode#refreshVolumes and BPOfferService#registrationSucceeded. (Uma Maheswara Rao G via yliu) Date: Thu, 8 Oct 2015 02:37:18 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2 2f4bcdef8 -> 22ed1471b HDFS-9137. DeadLock between DataNode#refreshVolumes and BPOfferService#registrationSucceeded. (Uma Maheswara Rao G via yliu) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/22ed1471 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/22ed1471 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/22ed1471 Branch: refs/heads/branch-2 Commit: 22ed1471bd5ef5988432fb4ae8034f4f90185405 Parents: 2f4bcde Author: yliu Authored: Thu Oct 8 10:26:30 2015 +0800 Committer: yliu Committed: Thu Oct 8 10:26:30 2015 +0800 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/datanode/DataNode.java | 25 +++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/22ed1471/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 9250c2b..756052c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1169,6 +1169,9 @@ Release 2.8.0 - UNRELEASED HDFS-9211. Fix incorrect version in hadoop-hdfs-native-client/pom.xml from HDFS-9170 branch-2 backport. (Eric Payne via wang) + HDFS-9137. DeadLock between DataNode#refreshVolumes and + BPOfferService#registrationSucceeded. (Uma Maheswara Rao G via yliu) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/22ed1471/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index d1e0160..b9be20e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -502,12 +502,29 @@ public class DataNode extends ReconfigurableBase public void reconfigurePropertyImpl(String property, String newVal) throws ReconfigurationException { if (property.equals(DFS_DATANODE_DATA_DIR_KEY)) { + IOException rootException = null; try { LOG.info("Reconfiguring " + property + " to " + newVal); this.refreshVolumes(newVal); } catch (IOException e) { - throw new ReconfigurationException(property, newVal, - getConf().get(property), e); + rootException = e; + } finally { + // Send a full block report to let NN acknowledge the volume changes. + try { + triggerBlockReport( + new BlockReportOptions.Factory().setIncremental(false).build()); + } catch (IOException e) { + LOG.warn("Exception while sending the block report after refreshing" + + " volumes " + property + " to " + newVal, e); + if (rootException == null) { + rootException = e; + } + } finally { + if (rootException != null) { + throw new ReconfigurationException(property, newVal, + getConf().get(property), rootException); + } + } } } else { throw new ReconfigurationException( @@ -689,10 +706,6 @@ public class DataNode extends ReconfigurableBase conf.set(DFS_DATANODE_DATA_DIR_KEY, Joiner.on(",").join(effectiveVolumes)); dataDirs = getStorageLocations(conf); - - // Send a full block report to let NN acknowledge the volume changes. - triggerBlockReport(new BlockReportOptions.Factory() - .setIncremental(false).build()); } }