HDFS-4867. metaSave NPEs when there are invalid blocks in repl queue. Contributed by Plamen Jeliazkov and Ravi Prakash.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1490433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Konstantin Shvachko 2013-06-06 20:44:40 +00:00
parent d46e160862
commit 8854c210bd
3 changed files with 5 additions and 4 deletions

View File

@ -3114,6 +3114,9 @@ Release 0.23.9 - UNRELEASED
BUG FIXES
HDFS-4867. metaSave NPEs when there are invalid blocks in repl queue.
(Plamen Jeliazkov and Ravi Prakash via shv)
Release 0.23.8 - 2013-06-05
INCOMPATIBLE CHANGES

View File

@ -458,7 +458,8 @@ private void dumpBlockMeta(Block block, PrintWriter out) {
numReplicas.decommissionedReplicas();
if (block instanceof BlockInfo) {
String fileName = ((BlockInfo)block).getBlockCollection().getName();
BlockCollection bc = ((BlockInfo) block).getBlockCollection();
String fileName = (bc == null) ? "[orphaned]" : bc.getName();
out.print(fileName + ": ");
}
// l: == live:, d: == decommissioned c: == corrupt e: == excess

View File

@ -24,11 +24,8 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DFSConfigKeys;