cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: atomicity of a row write
Date Tue, 24 Jan 2012 08:07:28 GMT
On Mon, Jan 23, 2012 at 9:20 PM, Guy Incognito <dnd1066@gmail.com> wrote:
> hi all,
>
> having read: http://wiki.apache.org/cassandra/FAQ#batch_mutate_atomic
>
> i would like some clarification:
>
> is a write to a single row key in a single column family atomic in the sense
> that i can do a batch mutate where i
>
> 1) write col 'A' to key 'B'
> 2) write 'col 'C' to key 'B'
>
> and either both column writes will succeed, or both will fail?

That is correct.

>  i won't get the situation where eg col 'A' is written and col 'B' fails, my client
> receives an error, but col 'A' is actually persisted and becomes visible to
> other clients?

No. You could however get into a situation where your client receives an error
but A *and* B are actually persisted. I.e, the atomicity concern persistence on
each individual node, so if the batch is persisted on some nodes but enough
nodes ides at the wrong time so that the consistency level cannot be met,
then Cassandra will return a timeout, even though the batch has been persisted
on some nodes.

> does this hold if i write key 'B' across two different column families?  (i
> assume not, but the faq doesn't seem to explicitly exclude this).

It does hold across column families.

> PS i'm not worried about isolation per se, i'm interested in what the
> 'eventually consistent' state is.

Good, because it's not isolated currently. 1.1 will introduce isolation
though (but only for a given key in a given column family, not across
column families as it is the case for atomicity).

--
Sylvain

Mime
View raw message