You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ha...@apache.org on 2008/09/11 22:49:29 UTC

svn commit: r694470 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

Author: hairong
Date: Thu Sep 11 13:49:28 2008
New Revision: 694470

URL: http://svn.apache.org/viewvc?rev=694470&view=rev
Log:
HADOOP-4054. Remove duplicate lease removal during edit log loading. Contributed by Hairong Kuang.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=694470&r1=694469&r2=694470&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Sep 11 13:49:28 2008
@@ -516,6 +516,9 @@
     HADOOP-4113. Changes to libhdfs to not exit on its own, rather return
     an error code to the caller. (Pete Wyckoff via dhruba)
 
+    HADOOP-4054. Remove duplicate lease removal during edit log loading.
+    (hairong)
+
 Release 0.18.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=694470&r1=694469&r2=694470&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java Thu Sep 11 13:49:28 2008
@@ -480,7 +480,6 @@
     FSDirectory fsDir = fsNamesys.dir;
     int numEdits = 0;
     int logVersion = 0;
-    INode old = null;
     String clientName = null;
     String clientMachine = null;
     String path = null;
@@ -608,7 +607,7 @@
                                    " clientMachine " + clientMachine);
           }
 
-          old = fsDir.unprotectedDelete(path, mtime);
+          fsDir.unprotectedDelete(path, mtime);
 
           // add to the file tree
           INodeFile node = (INodeFile)fsDir.unprotectedAddFile(
@@ -633,15 +632,6 @@
                                       null);
             fsDir.replaceNode(path, node, cons);
             fsNamesys.leaseManager.addLease(cons.clientName, path);
-          } else if (opcode == OP_CLOSE) {
-            //
-            // Remove lease if it exists.
-            //
-            if (old.isUnderConstruction()) {
-              INodeFileUnderConstruction cons = (INodeFileUnderConstruction)
-                                                   old;
-              fsNamesys.leaseManager.removeLease(cons.clientName, path);
-            }
           }
           break;
         } 
@@ -676,11 +666,7 @@
           }
           path = FSImage.readString(in);
           timestamp = readLong(in);
-          old = fsDir.unprotectedDelete(path, timestamp);
-          if (old != null && old.isUnderConstruction()) {
-            INodeFileUnderConstruction cons = (INodeFileUnderConstruction)old;
-            fsNamesys.leaseManager.removeLease(cons.clientName, path);
-          }
+          fsDir.unprotectedDelete(path, timestamp);
           break;
         }
         case OP_MKDIR: {