You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Haijia Zhou <le...@gmail.com> on 2012/04/17 01:28:00 UTC

Is htable.delete(List) transactional?

Very simple question as the subject shows:
Is htable.delete(List<Delete>) transactional?
Say if I am to delete 1000 rows and in the middle of deletion some error
occurs, then will the whole deletion operation get rolled back or will it
end up with  partial deletion?

Thanks

Re: Is htable.delete(List) transactional?

Posted by Haijia Zhou <le...@gmail.com>.
I see, thanks a lot!

On Mon, Apr 16, 2012 at 7:41 PM, Ian Varley <iv...@salesforce.com> wrote:

> More complex answer: generally, nothing that involves more than a single
> row in HBase is transactional. :)
>
> It's possible that HBase might get some limited form of multi-row
> transactions in the future (see HBase-5229<
> https://issues.apache.org/jira/browse/HBASE-5229> for more on that) but
> even then, things would only be transactional within a single region
> server, which means it's not really a general solution for the case you
> mention below (short of some external guarantee that all of your deletes
> are on the same RS).
>
> That said: mutations are generally idempotent in HBase (except for
> increments). So if you get an exception, it's usually OK to just retry the
> whole thing.
>
> Ian
>
> On Apr 16, 2012, at 6:33 PM, Jean-Daniel Cryans wrote:
>
> Simple answer: it's not transactional.
>
> J-D
>
> On Mon, Apr 16, 2012 at 4:28 PM, Haijia Zhou <leonster@gmail.com<mailto:
> leonster@gmail.com>> wrote:
> Very simple question as the subject shows:
> Is htable.delete(List<Delete>) transactional?
> Say if I am to delete 1000 rows and in the middle of deletion some error
> occurs, then will the whole deletion operation get rolled back or will it
> end up with  partial deletion?
>
> Thanks
>
>

Re: Is htable.delete(List) transactional?

Posted by Ian Varley <iv...@salesforce.com>.
More complex answer: generally, nothing that involves more than a single row in HBase is transactional. :)

It's possible that HBase might get some limited form of multi-row transactions in the future (see HBase-5229<https://issues.apache.org/jira/browse/HBASE-5229> for more on that) but even then, things would only be transactional within a single region server, which means it's not really a general solution for the case you mention below (short of some external guarantee that all of your deletes are on the same RS).

That said: mutations are generally idempotent in HBase (except for increments). So if you get an exception, it's usually OK to just retry the whole thing.

Ian

On Apr 16, 2012, at 6:33 PM, Jean-Daniel Cryans wrote:

Simple answer: it's not transactional.

J-D

On Mon, Apr 16, 2012 at 4:28 PM, Haijia Zhou <le...@gmail.com>> wrote:
Very simple question as the subject shows:
Is htable.delete(List<Delete>) transactional?
Say if I am to delete 1000 rows and in the middle of deletion some error
occurs, then will the whole deletion operation get rolled back or will it
end up with  partial deletion?

Thanks


Re: Is htable.delete(List) transactional?

Posted by Jean-Daniel Cryans <jd...@apache.org>.
Simple answer: it's not transactional.

J-D

On Mon, Apr 16, 2012 at 4:28 PM, Haijia Zhou <le...@gmail.com> wrote:
> Very simple question as the subject shows:
> Is htable.delete(List<Delete>) transactional?
> Say if I am to delete 1000 rows and in the middle of deletion some error
> occurs, then will the whole deletion operation get rolled back or will it
> end up with  partial deletion?
>
> Thanks