hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1415502 - in /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
Date Fri, 30 Nov 2012 06:01:55 GMT
Author: suresh
Date: Fri Nov 30 06:01:51 2012
New Revision: 1415502

URL: http://svn.apache.org/viewvc?rev=1415502&view=rev
Log:
HDFS-4233. NN keeps serving even after no journals started while rolling edit. Contributed
by Kihwal Lee.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1415502&r1=1415501&r2=1415502&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Fri Nov
30 06:01:51 2012
@@ -11,6 +11,8 @@ Release 0.23.6 - UNRELEASED
   OPTIMIZATIONS
 
   BUG FIXES
+    HDFS-4233. NN keeps serving even after no journals started while rolling
+    edit. (Kihwal Lee via suresh)
 
 Release 0.23.5 - UNRELEASED
 

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=1415502&r1=1415501&r2=1415502&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Fri Nov 30 06:01:51 2012
@@ -440,7 +440,8 @@ public class FSEditLog  {
       synchronized (this) {
         if (sync) {
           try {
-            if (badJournals.size() >= journals.size()) {
+            if (badJournals.size() >= journals.size() ||
+                candidateJournals.isEmpty()) {
               final String msg =
                 "Could not sync enough journals to persistent storage. "
                 + "Unsynced transactions: " + (txid - synctxid);

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java?rev=1415502&r1=1415501&r2=1415502&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
Fri Nov 30 06:01:51 2012
@@ -47,6 +47,7 @@ import org.apache.hadoop.hdfs.server.com
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType;
 import org.apache.hadoop.hdfs.server.namenode.NNStorage;
 import org.apache.hadoop.test.GenericTestUtils;
+import org.apache.hadoop.util.ExitUtil.ExitException;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.log4j.Level;
 import org.aspectj.util.FileUtil;
@@ -185,7 +186,9 @@ public class TestEditLog extends TestCas
     MiniDFSCluster cluster = null;
     FileSystem fileSys = null;
     try {
-      cluster = new MiniDFSCluster.Builder(conf).numDataNodes(NUM_DATA_NODES).build();
+      cluster = new MiniDFSCluster.Builder(conf)
+          .numDataNodes(NUM_DATA_NODES)
+          .checkExitOnShutdown(false).build();
       cluster.waitActive();
       fileSys = cluster.getFileSystem();
       final FSNamesystem namesystem = cluster.getNamesystem();
@@ -212,6 +215,15 @@ public class TestEditLog extends TestCas
       
       editLog.logSetReplication("fakefile", (short) 2);
       editLog.logSync();
+
+      // logSync() should fail if there is no active journal.
+      editLog.endCurrentLogSegment(true);
+      editLog.logSetReplication("fakefile", (short) 3);
+      try {
+        editLog.logSync();
+        fail("logSync() should have failed when no journal is active.");
+      } catch (ExitException e) { }
+      
       
       editLog.close();
     } finally {



Mime
View raw message