Переглянути джерело

HADOOP-3511. Namenode should not restore the root's quota if the quota was not saved in the image. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@664205 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 17 роки тому
батько
коміт
a7952ab165

+ 3 - 0
CHANGES.txt

@@ -531,6 +531,9 @@ Trunk (unreleased changes)
     HADOOP-3491. Name-node shutdown causes InterruptedException in 
     ResolutionMonitor. (Lohit Vijayarenu via shv)
 
+    HADOOP-3511. Fixes namenode image to not set the root's quota to an
+    invalid value when the quota was not saved in the image. (hairong)
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

+ 3 - 1
src/java/org/apache/hadoop/dfs/FSImage.java

@@ -786,7 +786,9 @@ class FSImage extends Storage {
         }
         if (path.length() == 0) { // it is the root
           // update the root's attributes
-          fsDir.rootDir.setQuota(quota);
+          if (quota != -1) {
+            fsDir.rootDir.setQuota(quota);
+          }
           fsDir.rootDir.setModificationTime(modificationTime);
           fsDir.rootDir.setPermissionStatus(permissions);
           continue;

+ 1 - 1
src/java/org/apache/hadoop/dfs/QuotaExceededException.java

@@ -46,7 +46,7 @@ public final class QuotaExceededException extends IOException {
   public String getMessage() {
     String msg = super.getMessage();
     if (msg == null) {
-      return "The quota" + pathName==null?"":(" of " + pathName) + 
+      return "The quota" + (pathName==null?"":(" of " + pathName)) + 
           " is exceeded: quota=" + quota + " count=" + count;
     } else {
       return msg;