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

ASF GitHub Bot commented on PHOENIX-7106:
-----------------------------------------

virajjasani commented on PR #1736:
URL: https://github.com/apache/phoenix/pull/1736#issuecomment-1895124476

   @gjacoby126 i agree with your concerns and i really wish there was some 
level of possible way to make the tests generic, but honestly its almost 
impossible to make tests generic by using parameterized argument because of 
several reasons:
   
   1. We need to use `hbase.client.scanner.max.result.size` before setting up 
`PhoenixTestDriver`
   2. Set `phoenix.scanning.result.post.dummy.process` to a class that can 
process region moves after dummy is received by client (depending on how 
aggressive tests are, we need custom logic here)
   3. Set `phoenix.scanning.result.post.valid.process` for some tests
   4. Set `phoenix.server.page.size.ms` to 0ms to generate frequent timeouts at 
server side
   5. Depending on tests, we also need to move regions after specific num of 
`rs#next` calls
   6. Region move logic has to be very specific: only move regions of tables 
that are really going to be used by queries e.g. data table and index table for 
the given query. If we move all regions (including hbase and phoenix system 
tables), tests take 5x more time than what they do with the current setup.
   
   In fact, initially i was able to reduce the patch size from ~19k to < 15k by 
adding `ParallelStatsDisabledWithRegionMovesIT`, which is now being extended by 
several tests.




> Data Integrity issues due to invalid rowkeys returned by various coprocessors
> -----------------------------------------------------------------------------
>
>                 Key: PHOENIX-7106
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7106
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.2.0, 5.1.4
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Blocker
>             Fix For: 5.2.0, 5.1.4
>
>
> HBase scanner interface expects server to perform scan of the cells from 
> HFile or Block cache and return consistent data i.e. rowkey of the cells 
> returned should stay in the range of the scan boundaries. When a region moves 
> and scanner needs reset, or if the current row is too large and the server 
> returns partial row, the subsequent scanner#next is supposed to return 
> remaining cells. When this happens, cell rowkeys returned by servers i.e. any 
> coprocessors is expected to be in the scan boundary range so that server can 
> reliably perform its validation and return remaining cells as expected.
> Phoenix client initiates serial or parallel scans from the aggregators based 
> on the region boundaries and the scan boundaries are sometimes adjusted based 
> on where optimizer provided key ranges, to include tenant boundaries, salt 
> boundaries etc. After the client opens the scanner and performs scan 
> operation, some of the coprocs return invalid rowkey for the following cases:
>  # Grouped aggregate queries
>  # Some Ungrouped aggregate queries
>  # Offset queries
>  # Dummy cells returned with empty rowkey
>  # Update statistics queries
>  # Uncovered Index queries
>  # Ordered results at server side
>  # ORDER BY DESC on rowkey
>  # Global Index read-repair
>  # Paging region scanner with HBase scanner reopen
>  # ORDER BY on non-pk column(s) with/without paging
>  # GROUP BY on non-pk column(s) with/without paging
> Since many of these cases return reserved rowkeys, they are likely not going 
> to match scan or region boundaries. It has potential to cause data integrity 
> issues in certain scenarios as explained above. Empty rowkey returned by 
> server can be treated as end of the region scan by HBase client.
> With the paging feature enabled, if the page size is kept low, we have higher 
> chances of scanners returning dummy cell, resulting in increased num of RPC 
> calls for better latency and timeouts. We should return only valid rowkey in 
> the scan range for all the cases where we perform above mentioned operations 
> like complex aggregate or offset queries etc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to