Repository: hadoop Updated Branches: refs/heads/HDFS-7240 407412363 -> cc63937e3
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/09cfa79d Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/09cfa79d Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/09cfa79d Branch: refs/heads/HDFS-7240 Commit: 09cfa79dbdf2fc06d70f5219ff2ce621be0092a8 Parents: 9739870 Author: Jing Zhao <[email protected]> Authored: Fri Mar 3 13:31:20 2017 -0800 Committer: Anu Engineer <[email protected]> Committed: Wed Mar 8 15:33:55 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/09cfa79d/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<FsVolumeImpl> { 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: [email protected] For additional commands, e-mail: [email protected]
