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

Andrew Purtell commented on HBASE-3416:
---------------------------------------

I hacked TestWideScanner to generate deep versioned test data and then reach in 
and update readers:

{code}
@@ -133,11 +139,19 @@ public class TestWideScanner extends HBaseTestCase {
         }
 
         results.clear();
+
+        // trigger ChangedReadersObservers
+        Iterator<KeyValueScanner> scanners =
+          ((HRegion.RegionScanner)s).storeHeap.getHeap().iterator();
+        while (scanners.hasNext()) {
+          StoreScanner ss = (StoreScanner)scanners.next();
+          ss.updateReaders();
+        }
       } while (more);
 
       // assert that the scanner returned all values
       LOG.info("inserted " + inserted + ", scanned " + total);
-      assertTrue(total == inserted);
+      assertEquals(total, inserted);
 
       s.close();
     } finally {
{code}

All seems to work. Do you want that kind of layering violation in the suite 
though? Will be brittle. 

> For intra-row scanning, the update readers notification resets the query 
> matcher and can lead to incorrect behavior
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-3416
>                 URL: https://issues.apache.org/jira/browse/HBASE-3416
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.90.0
>            Reporter: Jonathan Gray
>             Fix For: 0.90.1
>
>         Attachments: HBASE-3416.patch
>
>
> In {{StoreScanner.resetScannerStack()}}, which is called on the first 
> {{next()}} call after readers have been updated, we do a query matcher reset. 
>  Normally this is not an issue because the query matcher does not need to 
> maintain state between rows.  However, if doing intra-row scanning w/ the 
> specified limit, we could have the query matcher reset in the middle of 
> reading a row.  This could lead to incorrect behavior (too many versions 
> coming back, etc).

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to