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 A3D8E200C31 for ; Wed, 8 Mar 2017 11:47:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A28E3160B86; Wed, 8 Mar 2017 10:47:32 +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 E6C19160B88 for ; Wed, 8 Mar 2017 11:47:31 +0100 (CET) Received: (qmail 21377 invoked by uid 500); 8 Mar 2017 10:47:28 -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 20748 invoked by uid 99); 8 Mar 2017 10:47:28 -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; Wed, 08 Mar 2017 10:47:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4E2D0E382F; Wed, 8 Mar 2017 10:47:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vvasudev@apache.org To: common-commits@hadoop.apache.org Date: Wed, 08 Mar 2017 10:47:34 -0000 Message-Id: <95afc8a4455d409b9b79fc2a85745043@git.apache.org> In-Reply-To: <9bbb8a187d214aa39965fa2d6a53d784@git.apache.org> References: <9bbb8a187d214aa39965fa2d6a53d784@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/50] [abbrv] hadoop git commit: HDFS-11476. Fix NPE in FsDatasetImpl#checkAndUpdate. Contributed by Xiaobing Zhou. archived-at: Wed, 08 Mar 2017 10:47:32 -0000 HDFS-11476. Fix NPE in FsDatasetImpl#checkAndUpdate. Contributed by Xiaobing Zhou. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ac5ae006 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ac5ae006 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ac5ae006 Branch: refs/heads/YARN-3926 Commit: ac5ae0065a127ac150a887fa6c6f3cffd86ef733 Parents: 2148b83 Author: Jing Zhao Authored: Fri Mar 3 13:31:20 2017 -0800 Committer: Jing Zhao Committed: Fri Mar 3 13:31:20 2017 -0800 ---------------------------------------------------------------------- .../server/datanode/fsdataset/impl/FsDatasetImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/ac5ae006/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index 6d00d75..aff19ce 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -2282,12 +2282,14 @@ class FsDatasetImpl implements FsDatasetSpi { if (memBlockInfo.getGenerationStamp() != diskGS) { File memMetaFile = FsDatasetUtil.getMetaFile(diskFile, memBlockInfo.getGenerationStamp()); - if (memMetaFile.exists()) { - if (memMetaFile.compareTo(diskMetaFile) != 0) { - LOG.warn("Metadata file in memory " - + memMetaFile.getAbsolutePath() - + " does not match file found by scan " - + (diskMetaFile == null? null: diskMetaFile.getAbsolutePath())); + if (fileIoProvider.exists(vol, memMetaFile)) { + String warningPrefix = "Metadata file in memory " + + memMetaFile.getAbsolutePath() + + " does not match file found by scan "; + if (!diskMetaFileExists) { + LOG.warn(warningPrefix + "null"); + } else if (memMetaFile.compareTo(diskMetaFile) != 0) { + LOG.warn(warningPrefix + diskMetaFile.getAbsolutePath()); } } else { // Metadata file corresponding to block in memory is missing --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org