Merge HDFS-4482. ReplicationMonitor thread can exit with NPE due to the race between delete and replication of same file. Contributed by Uma Maheswara Rao G.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1448716 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96b3905afd
commit
975d24feb1
|
@ -22,6 +22,9 @@ Release 2.0.4-beta - UNRELEASED
|
|||
but not in dfs.namenode.edits.dir are silently ignored. (Arpit Agarwal
|
||||
via szetszwo)
|
||||
|
||||
HDFS-4482. ReplicationMonitor thread can exit with NPE due to the race
|
||||
between delete and replication of same file. (umamahesh)
|
||||
|
||||
Release 2.0.3-alpha - 2013-02-06
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -1421,6 +1421,11 @@ public class FSDirectory implements Closeable {
|
|||
|
||||
// fill up the inodes in the path from this inode to root
|
||||
for (int i = 0; i < depth; i++) {
|
||||
if (inode == null) {
|
||||
NameNode.stateChangeLog.warn("Could not get full path."
|
||||
+ " Corresponding file might have deleted already.");
|
||||
return null;
|
||||
}
|
||||
inodes[depth-i-1] = inode;
|
||||
inode = inode.parent;
|
||||
}
|
||||
|
|
|
@ -237,7 +237,11 @@ abstract class INode implements Comparable<byte[]> {
|
|||
|
||||
String getLocalParentDir() {
|
||||
INode inode = isRoot() ? this : getParent();
|
||||
return (inode != null) ? inode.getFullPathName() : "";
|
||||
String parentDir = "";
|
||||
if (inode != null) {
|
||||
parentDir = inode.getFullPathName();
|
||||
}
|
||||
return (parentDir != null) ? parentDir : "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue