You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by pi...@gmail.com on 2011/02/28 22:06:25 UTC

How to achieve secondary index consistency for concurrent scans and updates?

Hi, is possible to achieve secondary index consistency for concurrent
scans and updates?

If I have data table with key UUID and index on time column then when
I scan index by time there can be obsolete data (am | right?).

For example there is topic table with time column (indexed).
When new post is inserted, topic time column is updatet too (by delete
index and reinsert new value?)
So when table scan goes on it can miss record witch is updated
(reinserted in already scaned values - am I right?).

Is there any solution for this example use case?

Regards

Re: How to achieve secondary index consistency for concurrent scans and updates?

Posted by Stack <st...@duboce.net>.
On Mon, Feb 28, 2011 at 1:06 PM,  <pi...@gmail.com> wrote:
> Hi, is possible to achieve secondary index consistency for concurrent
> scans and updates?
>

No.  Not natively, not without cross-row transaction support.   An
add-on, https://github.com/hbase-trx/hbase-transactional-tableindexed,
can get you what you need.

St.Ack

Re: How to achieve secondary index consistency for concurrent scans and updates?

Posted by Andrew Purtell <ap...@apache.org>.
> For example there is topic table with time column (indexed).
> When new post is inserted, topic time column is updatet too (by delete
> index and reinsert new value?)
> So when table scan goes on it can miss record witch is updated
> (reinserted in already scaned values - am I right?).

Since HBase scanners don't support snapshot isolation, and won't, I think it is a non-goal for secondary indexes also.
 
See hbase.apache.org/acid-semantics.html

"A scan is not a consistent view of a table. Scans do not exhibit snapshot isolation. Rather, scans have the following properties: ..."

    - Andy

> From: piotrek69@gmail.com <pi...@gmail.com>
> Subject: How to achieve secondary index consistency for concurrent scans and updates?
> To: user@hbase.apache.org
> Date: Monday, February 28, 2011, 1:06 PM
> Hi, is possible to achieve secondary
> index consistency for concurrent
> scans and updates?
> 
> If I have data table with key UUID and index on time column
> then when I scan index by time there can be obsolete data (am |
> right?).
> 
> For example there is topic table with time column (indexed).
> When new post is inserted, topic time column is updatet too (by delete
> index and reinsert new value?)
> So when table scan goes on it can miss record witch is updated
> (reinserted in already scaned values - am I right?).
> 
> Is there any solution for this example use case?
> 
> Regards
>