Author: jgray
Date: Wed Sep 28 15:50:46 2011
New Revision: 1176931

URL: http://svn.apache.org/viewvc?rev=1176931&view=rev
Log:
HBASE-4488  Store could miss rows during flush (Lars H via jgray)

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

Modified: hbase/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1176931&r1=1176930&r2=1176931&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Sep 28 15:50:46 2011
@@ -7,7 +7,9 @@ Release 0.93.0 - Unreleased
    HBASE-4433  avoid extra next (potentially a seek) if done with column/row
                (kannan via jgray)
 
-  BUGS
+  BUG FIXES
+   HBASE-4488  Store could miss rows during flush (Lars H via jgray)
+
 
 Release 0.92.0 - Unreleased
   INCOMPATIBLE CHANGES

Modified: 
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: 
http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1176931&r1=1176930&r2=1176931&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java 
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java 
Wed Sep 28 15:50:46 2011
@@ -40,7 +40,6 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.client.Scan;
@@ -198,8 +197,6 @@ public class Store implements HeapSize {
 
     // Check if this is in-memory store
     this.inMemory = family.isInMemory();
-    long maxFileSize = 0L;
-    HTableDescriptor hTableDescriptor = region.getTableDesc();
     this.blockingStoreFileCount =
       conf.getInt("hbase.hstore.blockingStoreFiles", 7);
 
@@ -499,7 +496,9 @@ public class Store implements HeapSize {
         writer.setTimeRangeTracker(snapshotTimeRangeTracker);
         try {
           List<KeyValue> kvs = new ArrayList<KeyValue>();
-          while (scanner.next(kvs)) {
+          boolean hasMore;
+          do {
+            hasMore = scanner.next(kvs);
             if (!kvs.isEmpty()) {
               for (KeyValue kv : kvs) {
                 writer.append(kv);
@@ -507,7 +506,7 @@ public class Store implements HeapSize {
               }
               kvs.clear();
             }
-          }
+          } while (hasMore);
         } finally {
           // Write out the log sequence number that corresponds to this output
           // hfile.  The hfile is current up to and including logCacheFlushId.


Reply via email to