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

Geoffrey Jacoby commented on PHOENIX-5768:
------------------------------------------

So, to make sure I'm understanding your argument correctly, [~kozdemir]:
 
1. For an immutable table the client is responsible for retries when an error 
is thrown back
2. Any situation in which a client ends up with an unverified row for more than 
a few moments would produce an error to the client which the client should have 
retried idempotently.
3. The idempotent retry should result in a verified row, and no problem
4. Therefore it's OK for GlobalIndexChecker to return unverified Cells from a 
read (effectively a "dirty" read) since the client should have fixed it before 
reading back. 

If we accept that argument, I agree that the attached PR is a good way to 
accomplish that, and I'd give a +1. I'm still leaning towards giving a +1, 
because we can't detect this condition in advance, and we have to do 
_something_ when it comes up. 

But I'm not sure I agree with the argument. There can be multiple clients and 
one can fail a write and a second client can read before the retry gets done. 

Therefore, I think as part of this JIRA or a related one, the documentation 
needs to make very clear that this case is unsupported and can result in dirty 
reads. Right now, there doesn't appear to be any promise in the immutable index 
documentation that I can find that these partial writes are supported, just 
informal guidance at my employer that it was OK. (Please correct me if I'm 
wrong, [~vincentpoon] or [~giacomotaylor]) 

Operators (including any of us at Salesforce) who might be doing this should 
move to mutable indexes. The index upgrades required to use the new framework 
might be a good opportunity to do so.  

> Supporting partial overwrites for immutable tables with indexes
> ---------------------------------------------------------------
>
>                 Key: PHOENIX-5768
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5768
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.14.3
>            Reporter: Kadir OZDEMIR
>            Assignee: Kadir OZDEMIR
>            Priority: Critical
>         Attachments: PHOENIX-5678.master.001.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Phoenix allows immutable table with indexes to be overwritten partially as 
> long as the indexed columns are not updated during partial overwrites. 
> However, there is no check/enforcement for this. The immutable index 
> mutations are prepared on the client side without reading the existing data 
> table rows. This means the index mutations prepared by the client will be 
> partial when the data table row mutations are partial. The new indexing 
> design assumes index rows are always full and all cells within an index row 
> have the same timestamp. On the read path, GlobalIndexChecker returns only 
> the cells with the most recent timestamp of the row. This means that if the 
> client updates the same row multiple times, the client will read back only 
> the most recent update which could be partial.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to