hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r926353 - in /hadoop/hbase/trunk: CHANGES.txt core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Date Mon, 22 Mar 2010 21:36:17 GMT
Author: stack
Date: Mon Mar 22 21:36:17 2010
New Revision: 926353

URL: http://svn.apache.org/viewvc?rev=926353&view=rev
Log:
HBASE-2358 Store doReconstructionLog will fail if oldlogfile.log is empty and won't load region

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=926353&r1=926352&r2=926353&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Mar 22 21:36:17 2010
@@ -250,6 +250,8 @@ Release 0.21.0 - Unreleased
    HBASE-2283  row level atomicity (Kannan Muthukkaruppan via Stack)
    HBASE-2355  Unsynchronized logWriters map is mutated from several threads in
                HLog splitting (Todd Lipcon via Andrew Purtell)
+   HBASE-2358  Store doReconstructionLog will fail if oldlogfile.log is empty
+               and won't load region (Cosmin Lehene via Stack)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=926353&r1=926352&r2=926353&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Mon Mar 22 21:36:17 2010
@@ -306,13 +306,14 @@ public class Store implements HConstants
       // Nothing to do.
       return -1;
     }
-    // Check its not empty.
-    FileStatus [] stats = this.fs.listStatus(reconstructionLog);
-    if (stats == null || stats.length == 0) {
+    FileStatus stat = this.fs.getFileStatus(reconstructionLog);
+    if (stat.getLen() <= 0) {
       LOG.warn("Passed reconstruction log " + reconstructionLog +
-        " is zero-length");
+        " is zero-length. Deleting existing file");
+       fs.delete(reconstructionLog, false);
       return -1;
     }
+
     // TODO: This could grow large and blow heap out.  Need to get it into
     // general memory usage accounting.
     long maxSeqIdInLog = -1;



Mime
View raw message