瀏覽代碼

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
Konstantin Shvachko 12 年之前
父節點
當前提交
fc105796d1

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

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

+ 1 - 4
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

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