hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory Chanan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-7051) Read/Updates (increment,checkAndPut) should properly read MVCC
Date Sun, 28 Oct 2012 02:27:12 GMT

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

Gregory Chanan commented on HBASE-7051:
---------------------------------------

@Ram:
regarding option 3: for an increment imagine you can just insert something into the memstore
that says "increment by x".  Since you don't have to read, you can just do what all the other
writes do (i.e. don't wait for MVCC, just hold the row lock up to the sync point).  Reads
become more complicated, of course.

Option 2:
I was just thinking you would need to spend some memory per-row to hold the MVCC.  Probably
okay (similar to the row lock already?), but would need some investigation.

@Lars:
If you were to assign this to yourself, what approach would you take?  Holding the row lock
until the WAL is synced during writes?  Waiting for all transactions to complete in read/updates?

I'm down for trying out the #2 idea.  We could benchmark it against the other approaches.
 Perhaps I should file a new JIRA for that?
                
> Read/Updates (increment,checkAndPut) should properly read MVCC
> --------------------------------------------------------------
>
>                 Key: HBASE-7051
>                 URL: https://issues.apache.org/jira/browse/HBASE-7051
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0
>            Reporter: Gregory Chanan
>             Fix For: 0.94.3, 0.96.0
>
>
> See, for example:
> {code}
> // TODO: Use MVCC to make this set of increments atomic to reads
> {code}
> Here's an example of what I can happen (would probably be good to write up a test case
for each read/update):
> Concurrent update via increment and put.
> The put grabs the row lock first and updates the memstore, but releases the row lock
before the MVCC is advanced.  Then, the increment grabs the row lock and reads right away,
reading the old value and incrementing based on that.
> There are a few options here:
> 1) Waiting for the MVCC to advance for read/updates: the downside is that you have to
wait for updates on other rows.
> 2) Have an MVCC per-row (table configuration): this avoids the unnecessary contention
of 1)
> 3) Transform the read/updates to write-only with rollup on read..  E.g. an increment
 would just have the number of values to increment.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message