You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2009/06/16 00:48:07 UTC

[jira] Commented: (HBASE-910) Scanner misses columns / rows when the scanner is obtained durring a memcache flush

    [ https://issues.apache.org/jira/browse/HBASE-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719833#action_12719833 ] 

stack commented on HBASE-910:
-----------------------------

Chatting more with Ryan, a simple fix to get around case where on a snapshot, scanners will miss what has been moved from memcache to snapshot would be the following:

{code}
durruti:cleantrunk stack$ svn diff src
Index: src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
===================================================================
--- src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (revision 785009)
+++ src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (working copy)
@@ -539,17 +539,14 @@
   }
 
   /**
-   * @return scanner on memcache and snapshot in this order (if snapshot is
-   * empty, returns only memcache scanner).
+   * @return scanner on memcache and snapshot in this order.
    */
   KeyValueScanner [] getScanners() {
     this.lock.readLock().lock();
     try {
-      boolean noss = this.snapshot == null || this.snapshot.isEmpty();
-      KeyValueScanner [] scanners =
-        new KeyValueScanner[noss? 1: 2];
+      KeyValueScanner [] scanners = new KeyValueScanner[2];
       scanners[0] = new MemcacheScanner(this.memcache);
-      if (!noss) scanners[1] = new MemcacheScanner(this.snapshot);
+      scanners[1] = new MemcacheScanner(this.snapshot);
       return scanners;
     } finally {
       this.lock.readLock().unlock();
durruti:cleantrunk stack$ svn up
At revision 785013.
durruti:cleantrunk stack$ svn diff src
Index: src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
===================================================================
--- src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (revision 785013)
+++ src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (working copy)
@@ -539,17 +539,14 @@
   }
 
   /**
-   * @return scanner on memcache and snapshot in this order (if snapshot is
-   * empty, returns only memcache scanner).
+   * @return scanner on memcache and snapshot in this order.
    */
   KeyValueScanner [] getScanners() {
     this.lock.readLock().lock();
     try {
-      boolean noss = this.snapshot == null || this.snapshot.isEmpty();
-      KeyValueScanner [] scanners =
-        new KeyValueScanner[noss? 1: 2];
+      KeyValueScanner [] scanners = new KeyValueScanner[2];
       scanners[0] = new MemcacheScanner(this.memcache);
-      if (!noss) scanners[1] = new MemcacheScanner(this.snapshot);
+      scanners[1] = new MemcacheScanner(this.snapshot);
       return scanners;
     } finally {
       this.lock.readLock().unlock();
{code}

In above, we always have open scanner on memcache and snapshot.  Usual case is snapshot is empty so nothing comes from here but if a snapshot happened, scanner would start getting its answers here rather than from memcache.  Closes a hole.  Don't need to call updateReaders.

> Scanner misses columns / rows when the scanner is obtained durring a memcache flush
> -----------------------------------------------------------------------------------
>
>                 Key: HBASE-910
>                 URL: https://issues.apache.org/jira/browse/HBASE-910
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>         Environment: latest trunk
>            Reporter: Clint Morgan
>            Assignee: stack
>            Priority: Blocker
>             Fix For: 0.19.0
>
>         Attachments: 910-v2.patch, hbase-910.patch
>
>
> I first noticed that some columns for a row were missing if they are coming from a scanner that was obtained while a memecache flush on the region was in progress. I tried to write a simple unit test to reproduce, however the problem I get in the unit test is that some rows are being missed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.