hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1570078 - in /hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs: CHANGES_HDFS-5535.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
Date Thu, 20 Feb 2014 03:58:00 GMT
Author: szetszwo
Date: Thu Feb 20 03:57:59 2014
New Revision: 1570078

URL: http://svn.apache.org/r1570078
Log:
HDFS-5980. Rollback does not need to load edits.  Contributed by jing9

Modified:
    hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt
    hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
    hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java

Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt?rev=1570078&r1=1570077&r2=1570078&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt
(original)
+++ hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt
Thu Feb 20 03:57:59 2014
@@ -59,3 +59,4 @@ HDFS-5535 subtasks:
     HDFS-5976. Create unit tests for downgrade and finalize rolling upgrade.
     (Haohui Mai via Arpit Agarwal)
 
+    HDFS-5980. Rollback does not need to load edits.  (jing9 via szetszwo)

Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java?rev=1570078&r1=1570077&r2=1570078&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
(original)
+++ hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
Thu Feb 20 03:57:59 2014
@@ -624,16 +624,15 @@ public class FSImage implements Closeabl
     prog.endPhase(Phase.LOADING_FSIMAGE);
     long txnsAdvanced = 0;
     
-    loadEdits(editStreams, target, startOpt, recovery);
-    if (rollingRollback) {
-      // Trigger the rollback for rolling upgrade. 
-      // Here lastAppliedTxId == (markerTxId - 1), and we should decrease 1 from
-      // lastAppliedTxId for the start-segment transaction.
-      rollingRollback(lastAppliedTxId--, imageFiles.get(0).getCheckpointTxId());
-      needToSave = false;
-    } else {
+    if (!rollingRollback) {
+      loadEdits(editStreams, target, startOpt, recovery);
       needToSave |= needsResaveBasedOnStaleCheckpoint(imageFile.getFile(),
           txnsAdvanced);
+    } else {
+      // Trigger the rollback for rolling upgrade. Here lastAppliedTxId equals
+      // to the last txid in rollback fsimage.
+      rollingRollback(lastAppliedTxId + 1, imageFiles.get(0).getCheckpointTxId());
+      needToSave = false;
     }
     editLog.setNextTxId(lastAppliedTxId + 1);
     return needToSave;
@@ -768,11 +767,8 @@ public class FSImage implements Closeabl
           // have been successfully applied before the error.
           lastAppliedTxId = loader.getLastAppliedTxId();
         }
-        boolean rollingRollback = StartupOption
-            .isRollingUpgradeRollback(startOpt);
         // If we are in recovery mode, we may have skipped over some txids.
-        if (editIn.getLastTxId() != HdfsConstants.INVALID_TXID
-            && !rollingRollback) {
+        if (editIn.getLastTxId() != HdfsConstants.INVALID_TXID) {
           lastAppliedTxId = editIn.getLastTxId();
         }
       }

Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java?rev=1570078&r1=1570077&r2=1570078&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
(original)
+++ hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
Thu Feb 20 03:57:59 2014
@@ -268,7 +268,7 @@ public class TestRollingUpgrade {
       }
 
       // Restart should succeed!
-//      cluster.restartNameNode();
+      cluster.restartNameNode();
 
       cluster.restartNameNode("-rollingUpgrade", "rollback");
       {



Mime
View raw message