HDFS-4308. addBlock() should persist file blocks once. Contributed by Plamen Jeliazkov.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1426700 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Konstantin Shvachko 2012-12-29 04:11:58 +00:00
parent 402eb18513
commit fc105796d1
2 changed files with 4 additions and 4 deletions

View File

@ -629,6 +629,9 @@ Release 2.0.3-alpha - Unreleased
HDFS-4140. fuse-dfs handles open(O_TRUNC) poorly. (Colin Patrick McCabe
via atm)
HDFS-4308. addBlock() should persist file blocks once.
(Plamen Jeliazkov via shv)
BREAKDOWN OF HDFS-3077 SUBTASKS
HDFS-3077. Quorum-based protocol for reading and writing edit logs.

View File

@ -394,19 +394,16 @@ public class FSDirectory implements Closeable {
/**
* Remove a block from the file.
*/
boolean removeBlock(String path, INodeFileUnderConstruction fileNode,
void removeBlock(String path, INodeFileUnderConstruction fileNode,
Block block) throws IOException {
waitForReady();
writeLock();
try {
unprotectedRemoveBlock(path, fileNode, block);
// write modified block locations to log
fsImage.getEditLog().logOpenFile(path, fileNode);
} finally {
writeUnlock();
}
return true;
}
void unprotectedRemoveBlock(String path, INodeFileUnderConstruction fileNode,