Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri. (cherry picked from commit 303c8dc9b6c853c0939ea9ba14388897cc258071)
Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/948d0ac7 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/948d0ac7 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/948d0ac7 Branch: refs/heads/branch-2.7 Commit: 948d0ac72d34cfae49d1780f718346b300802f0a Parents: 724a5f3 Author: Inigo Goiri <elgo...@gmail.com> Authored: Fri May 26 13:15:44 2017 -0700 Committer: Konstantin V Shvachko <s...@apache.org> Committed: Fri May 26 13:36:34 2017 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/948d0ac7/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 9ca3b9a..7e4994a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -326,6 +326,8 @@ Release 2.7.4 - UNRELEASED HDFS-11445. FSCK shows overall health stauts as corrupt even one replica is corrupt. (Brahma Reddy Battula) + Fix NPE in LazyPersistFileScrubber. (Inigo Goiri via shv) + Release 2.7.3 - 2016-08-25 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/948d0ac7/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 7f701e3..ce8878f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -4682,9 +4682,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, while (it.hasNext()) { Block b = it.next(); BlockInfoContiguous blockInfo = blockManager.getStoredBlock(b); - if (blockInfo.getBlockCollection().getStoragePolicyID() - == lpPolicy.getId()) { - filesToDelete.add(blockInfo.getBlockCollection()); + if (blockInfo == null) { + LOG.info("Cannot find block info for block " + b); + } else { + if (blockInfo.getBlockCollection().getStoragePolicyID() + == lpPolicy.getId()) { + filesToDelete.add(blockInfo.getBlockCollection()); + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org