noslowerdna opened a new pull request, #8485:
URL: https://github.com/apache/hbase/pull/8485

   # [HBASE-27691](https://issues.apache.org/jira/browse/HBASE-27691)
   
   ### What changes were proposed in this pull request?
   
   This patch disables `StoreScanner`'s initial lazy seek for filtered non-Get 
scans. Doing so prevents synthetic lazy-seek Cells from being exposed to 
server-side Filters and Comparators, while retaining lazy seeking for 
unfiltered Scans and Gets.
   
   ### Why are the changes needed?
   
   A region start boundary is not guaranteed to be a valid application row key. 
Passing its synthetic Cell to a `RowFilter` comparator violates the Filter 
contract that `filterRowKey` receives the first actual Cell of a row and can 
result in unexpected exceptions when Filter / Comparator code attempts to parse 
a seemingly truncated or otherwise malformed row key.
   
   In our case that manifested like this:
   
   ```
   Caused by: java.lang.RuntimeException: java.io.EOFException
        at com.package.MyComparator.compareTo(MyComparator.java:133)
        at 
org.apache.hadoop.hbase.PrivateCellUtil.compareRow(PrivateCellUtil.java:1240)
        at 
org.apache.hadoop.hbase.filter.CompareFilter.compareRow(CompareFilter.java:148)
        at 
org.apache.hadoop.hbase.filter.RowFilter.filterRowKey(RowFilter.java:90)
        at 
org.apache.hadoop.hbase.filter.FilterListWithOR.filterRowKey(FilterListWithOR.java:345)
        at 
org.apache.hadoop.hbase.filter.FilterList.filterRowKey(FilterList.java:152)
        at 
org.apache.hadoop.hbase.filter.FilterListWithAND.filterRowKey(FilterListWithAND.java:227)
        at 
org.apache.hadoop.hbase.filter.FilterList.filterRowKey(FilterList.java:152)
        at 
org.apache.hadoop.hbase.filter.FilterWrapper.filterRowKey(FilterWrapper.java:108)
        at 
org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.filterRowKey(HRegion.java:7545)
        at 
org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextInternal(HRegion.java:7361)
        at 
org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextRaw(HRegion.java:7153)
        at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:3330)
        ...
   ```
   
   This change reinstates the protection intended by 
[HBASE-6562](https://issues.apache.org/jira/browse/HBASE-6562), using its later 
proposed (unmerged) [eager initial seek 
patch](https://issues.apache.org/jira/secure/attachment/12563194/6562-0.96-v1.txt).
 
   
   ### How was this patch tested?
   
   A ROWCOL Bloom regression test verifies that a Comparator sees only the 
persisted row, not a synthetic region-boundary Cell. Focused tests also cover 
each lazy-seek decision branch.
   
   ```bash
   mvn -ntp -pl hbase-server -am \
     -Dtest=TestScanner \
     -Dsurefire.failIfNoSpecifiedTests=false \
     test
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to