incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Schuller <peter.schul...@infidyne.com>
Subject Re: Consistency question caused by Read_all and Write_one
Date Fri, 10 Dec 2010 20:59:33 GMT
> Assume there are two write operation happens issued by the same application
> by this order: write_one("1", "Dan") ; write_one("1", "Ken").
> What will Read_all("1") get?

Assuming read_all means reading at consistency level ALL, it sees the
latest value ("Ken").

> Assume the above two write operations happens exactly the same time in two
> applications,
> Again what will Read_all("1") get?

If they happen exactly at the same time, in the sense that the
timestamps (micro second) end up being exactly equal, IIRC the
tie-breaker is the value (I think the greater value wins). But note
that this is likely not a problem; if it is you probably already have
an issue with races anyway. Unless you have some very very strict
synchronization going on between your clients, it will be essentially
equivalent to an outside observer whether two clients wrote two values
with timestamps of almost the same microseconds, or wrote two values
with timestamps that are exactly equal. In both cases you're
effectively racing and you'll see afterwards who won. If you require
otherwise you probably require synchronization, regardless of what
Cassandra does in terms of tie breaking with identical timestamps (if
you have such strict ordering requirements then by what means do you
allocate the timestamps in a guaranteed-in-order way? you're probably
not).

-- 
/ Peter Schuller

Mime
View raw message