|
@@ -2562,7 +2562,8 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
* (e.g if not all blocks have reached minimum replication yet)
|
|
* (e.g if not all blocks have reached minimum replication yet)
|
|
* @throws IOException on error (eg lease mismatch, file not open, file deleted)
|
|
* @throws IOException on error (eg lease mismatch, file not open, file deleted)
|
|
*/
|
|
*/
|
|
- boolean completeFile(String src, String holder, ExtendedBlock last)
|
|
|
|
|
|
+ boolean completeFile(String src, String holder,
|
|
|
|
+ ExtendedBlock last, long fileId)
|
|
throws SafeModeException, UnresolvedLinkException, IOException {
|
|
throws SafeModeException, UnresolvedLinkException, IOException {
|
|
if (NameNode.stateChangeLog.isDebugEnabled()) {
|
|
if (NameNode.stateChangeLog.isDebugEnabled()) {
|
|
NameNode.stateChangeLog.debug("DIR* NameSystem.completeFile: " +
|
|
NameNode.stateChangeLog.debug("DIR* NameSystem.completeFile: " +
|
|
@@ -2579,8 +2580,8 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
throw new SafeModeException("Cannot complete file " + src, safeMode);
|
|
throw new SafeModeException("Cannot complete file " + src, safeMode);
|
|
}
|
|
}
|
|
src = FSDirectory.resolvePath(src, pathComponents, dir);
|
|
src = FSDirectory.resolvePath(src, pathComponents, dir);
|
|
- success = completeFileInternal(src, holder,
|
|
|
|
- ExtendedBlock.getLocalBlock(last));
|
|
|
|
|
|
+ success = completeFileInternal(src, holder,
|
|
|
|
+ ExtendedBlock.getLocalBlock(last), fileId);
|
|
} finally {
|
|
} finally {
|
|
writeUnlock();
|
|
writeUnlock();
|
|
}
|
|
}
|
|
@@ -2591,14 +2592,13 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
}
|
|
}
|
|
|
|
|
|
private boolean completeFileInternal(String src,
|
|
private boolean completeFileInternal(String src,
|
|
- String holder, Block last) throws SafeModeException,
|
|
|
|
|
|
+ String holder, Block last, long fileId) throws SafeModeException,
|
|
UnresolvedLinkException, IOException {
|
|
UnresolvedLinkException, IOException {
|
|
assert hasWriteLock();
|
|
assert hasWriteLock();
|
|
final INodesInPath iip = dir.getLastINodeInPath(src);
|
|
final INodesInPath iip = dir.getLastINodeInPath(src);
|
|
final INodeFileUnderConstruction pendingFile;
|
|
final INodeFileUnderConstruction pendingFile;
|
|
try {
|
|
try {
|
|
- pendingFile = checkLease(src, INodeId.GRANDFATHER_INODE_ID,
|
|
|
|
- holder, iip.getINode(0));
|
|
|
|
|
|
+ pendingFile = checkLease(src, fileId, holder, iip.getINode(0));
|
|
} catch (LeaseExpiredException lee) {
|
|
} catch (LeaseExpiredException lee) {
|
|
final INode inode = dir.getINode(src);
|
|
final INode inode = dir.getINode(src);
|
|
if (inode != null
|
|
if (inode != null
|