Author: stack
Date: Mon Mar 31 13:33:49 2008
New Revision: 643137

URL: http://svn.apache.org/viewvc?rev=643137&view=rev
Log:
HBASE-551 Master stuck splitting server logs in shutdown loop;
on eachiteration, edits are aggregated up into the millions
M src/java/org/apache/hadoop/hbase/HLog.java
    (splitLog): If an exception processing a split, catch it.
    In finally, close and delete the split. Don't try retrying.
    While in some circumstance, we might recover, its also
    likely that we just get same exception again. If so, and
    multiple files, we'll just accumulate edits until the
    kingdom comes. 

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=643137&r1=643136&r2=643137&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Mon Mar 31 13:33:49 2008
@@ -3,7 +3,8 @@
 
   BUG FIXES
    HBASE-550   EOF trying to read reconstruction log stops region deployment
-
+   HBASE-551   Master stuck splitting server logs in shutdown loop; on each
+               iteration, edits are aggregated up into the millions
 
 Release 0.1.0
 

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=643137&r1=643136&r2=643137&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 Mon 
Mar 31 13:33:49 2008
@@ -588,8 +588,21 @@
           if (LOG.isDebugEnabled()) {
             LOG.debug("Applied " + count + " total edits");
           }
+        } catch (IOException e) {
+          LOG.warn("Exception processing " + logfiles[i].getPath() +
+            " -- continuing. Possible DATA LOSS!", e);
         } finally {
-          in.close();
+          try {
+            in.close();
+          } catch (IOException e) {
+            LOG.warn("Close in finally threw exception -- continuing", e);
+          }
+          // Delete the input file now so we do not replay edits.  We could
+          // have gotten here because of an exception.  If so, probably
+          // nothing we can do about it. Replaying it, it could work but we
+          // could be stuck replaying for ever. Just continue though we
+          // could have lost some edits.
+          fs.delete(logfiles[i].getPath());
         }
       }
     } finally {


Reply via email to