You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2008/06/26 05:13:42 UTC

svn commit: r671710 - in /hadoop/hbase/branches/0.1: CHANGES.txt src/java/org/apache/hadoop/hbase/HLog.java

Author: stack
Date: Wed Jun 25 20:13:42 2008
New Revision: 671710

URL: http://svn.apache.org/viewvc?rev=671710&view=rev
Log:
HBASE-709 Deadlock while rolling WAL-log while finishing flush

Modified:
    hadoop/hbase/branches/0.1/CHANGES.txt
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HLog.java

Modified: hadoop/hbase/branches/0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/CHANGES.txt?rev=671710&r1=671709&r2=671710&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Wed Jun 25 20:13:42 2008
@@ -24,6 +24,7 @@
    HBASE-686   MemcacheScanner didn't return the first row(if it exists),
                because HScannerInterface's output incorrect (LN via Jim Kellerman)
    HBASE-613   Timestamp-anchored scanning fails to find all records
+   HBASE-709   Deadlock while rolling WAL-log while finishing flush
 
 Release 0.1.2 - 05/13/2008
 

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HLog.java?rev=671710&r1=671709&r2=671710&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HLog.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HLog.java Wed Jun 25 20:13:42 2008
@@ -362,8 +362,8 @@
    * @throws IOException
    */
   void append(Text regionName, Text tableName,
-      TreeMap<HStoreKey, byte[]> edits) throws IOException {
-    
+      TreeMap<HStoreKey, byte[]> edits)
+  throws IOException {
     if (closed) {
       throw new IOException("Cannot append; log is closed");
     }
@@ -386,23 +386,21 @@
         try {
           this.writer.append(logKey, logEdit);
         } catch (IOException e) { 
-          LOG.error("Could not append to log. Opening new log. Exception: ", e);
-          rollWriter();
-          try {
-          	this.writer.append(logKey, logEdit);
-          } catch (IOException e2) { 
-            LOG.fatal("Could not append to log the second time because " + 
-              e2.toString() + ", aborting.");
-            throw e2;
-          }
+          LOG.fatal("Could not append. Requesting close of log", e);
+          requestLogRoll();
+          throw e;
         }
         this.numEntries++;
       }
     }
     if (this.numEntries > this.maxlogentries) {
-      if (listener != null) {
-        listener.logRollRequested();
-      }
+      requestLogRoll();
+    }
+  }
+
+  private void requestLogRoll() {
+    if (this.listener != null) {
+      this.listener.logRollRequested();
     }
   }