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

Lars Hofhansl commented on PHOENIX-4323:
----------------------------------------

Reflecting on more... The issue occurs when index row-keys end being > the 
region end key.
That is perhaps not as unlikely as one thinks.

The region start and end keys are driven by the data in the main column family 
- those are the values that are actually being inserted, the index rows are 
written as a side-effect of those writes. Hence the region end key could be 
relative close to highest regular row key. Now let's take the row key and 
append the rest of the index data to it, the next byte after the row-key can be 
anything from 0-255, a higher value there can be fairly easily be outside of 
the region.

We can force the end-key to be higher somehow. We can also introduce a split 
policy avoiding splitting regions between rows and index rows.

I still think we cat pretty far by simply padding the rowkey part with 0 before 
appending the rest of the index key part.

We can always construct a case (like in this case allowing on a single row to 
exist in the region). Can we make a natural occurrence of this rare enough?


> LocalIndexes could fail if your data row is not in the same region as your 
> index region
> ---------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4323
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4323
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: churro morales
>            Assignee: Vincent Poon
>            Priority: Major
>         Attachments: LocalIndexIT.java
>
>
> This is not likely to happen, but if this does your data table and index 
> write will never succeed. 
> In HRegion.doMiniBatchMutation() 
> You create index rows in the preBatchMutate() then when you call checkRow() 
> on that index row the exception will bubble up if the index row is not in the 
> same region as your data row.  
> Like I said this is unlikely, but you would have to do a region merge to fix 
> this issue if encountered.  
> [~vincentpoon] has a test which he will attach to this JIRA showing an 
> example how this can happen. The write will never succeed unless you merge 
> regions if this ever happens. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to