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

Lars Hofhansl commented on HBASE-4583:
--------------------------------------

As discussed on rb (thank Prakash and Jon), this is a bit more complicated than 
expected. Because append and increment are not idempotent we have to produce 
serializable schedules
(when we start with a value of 1 and add 1 by two separate increment 
operations, the end result has to be 3, regardless of how the two increment 
operations are interleaved).

There are various ways to produce serializable schedules (pessimistic locking, 
optimistic locking with rechecking of pre conditions, snapshot isolation, etc), 
all which will probably mean worse performance for both append and increment.

As said above the current implementation sync's the WAL after the memstore is 
updated and the new values are visible to other threads, and after the locks 
are released. A failure to sync the WAL will leave uncommitted state in the 
memstore, in addition other threads can be see uncommitted state.

We can only safely make the changes available to other threads after (1) the 
WAL is committed (for these atomic, non-idempotent operations at least), at the 
same time we need to (2) retain the row lock until the rwcc is forwarded 
(otherwise two increment operations could come in and both see the same start 
value, leading to a non serializable schedule)... So my current patch is no 
good (it leads to problem (2))

(1) and (2) together mean that the WAL needs to be sync'ed with the row lock 
held (which would be quite a performance degradation).

Now, what we could do is use rwcc to make the changes to the CFs atomic, and 
still sync the WAL after all the locks are released (as we do now). With this 
compromise everything would be correct *unless* the sync'ing of WAL fails (the 
theme used for puts to release locks early, then forward rwcc, and do a 
rollback of the applied values if WAL sync fails, does not work here).

                
> Integrate RWCC with Append and Increment operations
> ---------------------------------------------------
>
>                 Key: HBASE-4583
>                 URL: https://issues.apache.org/jira/browse/HBASE-4583
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Assignee: Lars Hofhansl
>             Fix For: 0.94.0
>
>         Attachments: 4583-v2.txt, 4583-v3.txt, 4583-v4.txt, 4583.txt
>
>
> Currently Increment and Append operations do not work with RWCC and hence a 
> client could see the results of multiple such operation mixed in the same 
> Get/Scan.
> The semantics might be a bit more interesting here as upsert adds and removes 
> to and from the memstore.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to