瀏覽代碼

HDFS-1737. Federation: Update the layout version for federation changes. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-1052@1079619 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 14 年之前
父節點
當前提交
d13624d99f

+ 4 - 1
CHANGES.txt

@@ -223,7 +223,10 @@ Trunk (unreleased changes)
     via szetszwo)
 
     HDFS-1735. Federation: merge FSImage change in federation to
-    FSImage+NNStorage refactoring in trunk (suresh)
+    FSImage+NNStorage refactoring in trunk. (suresh)
+
+    HDFS-1737. Federation: Update the layout version for federation
+    changes. (suresh)
 
   IMPROVEMENTS
 

+ 2 - 2
src/java/org/apache/hadoop/hdfs/protocol/FSConstants.java

@@ -88,7 +88,7 @@ public interface FSConstants {
   // Version is reflected in the data storage file.
   // Versions are negative.
   // Decrement LAYOUT_VERSION to define a new version.
-  public static final int LAYOUT_VERSION = -27;
+  public static final int LAYOUT_VERSION = -28;
   // Current version: 
-  // -27: remove intentionally corrupt pre-0.13 image directory
+  // -28: Adding support for block pools and multiple namenodes
 }

+ 1 - 1
src/java/org/apache/hadoop/hdfs/server/common/Storage.java

@@ -79,7 +79,7 @@ public abstract class Storage extends StorageInfo {
   public static final int PRE_RBW_LAYOUT_VERSION = -19;
   
   // last layout version that is before federation
-  public static final int LAST_PRE_FEDERATION_LAYOUT_VERSION = -24;
+  public static final int LAST_PRE_FEDERATION_LAYOUT_VERSION = -27;
   
   private   static final String STORAGE_FILE_LOCK     = "in_use.lock";
   protected static final String STORAGE_FILE_VERSION  = "VERSION";

+ 3 - 3
src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java

@@ -135,7 +135,9 @@ public class DataStorage extends Storage {
       return;
     }
     assert FSConstants.LAYOUT_VERSION == nsInfo.getLayoutVersion() :
-      "Data-node and name-node layout versions must be the same.";
+      "Data-node version " + FSConstants.LAYOUT_VERSION + 
+      " and name-node layout version " + nsInfo.getLayoutVersion() + 
+      " must be the same.";
     
     // 1. For each data directory calculate its state and 
     // check whether all is consistent before transitioning.
@@ -186,8 +188,6 @@ public class DataStorage extends Storage {
       doTransition(getStorageDir(idx), nsInfo, startOpt);
       assert this.getLayoutVersion() == nsInfo.getLayoutVersion() :
         "Data-node and name-node layout versions must be the same.";
-      assert this.getCTime() == nsInfo.getCTime() :
-        "Data-node and name-node CTimes must be the same.";
     }
     
     // make sure we have storage id set - if not - generate new one