cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <>
Subject Re: Question about eventually consistent in Cassandra
Date Wed, 03 Aug 2011 00:40:24 GMT
Columns are reconciled using the following logic:

1) DeletedColumns always win. If there are two deletes the highest timestamp wins 
2) For non deleted columns the one with the highest timestamp wins. 
3) In the case of timestamp collision the column with the highest value (by comparing bytes)

In practice you normally only see timestamp collisions when something is wrong in your code.
As a side there is nothing that says the timestamp must be a time stamp, it's just a 64bit
int sequence that the server uses to reconcile columns of the same name.  

In general it's best to avoid situations where you rely on highly sync'd clocks. 

Hope that helps. 

Aaron Morton
Freelance Cassandra Developer

On 3 Aug 2011, at 10:05, Konstantin Naryshkin wrote:

> I believe that what would happen is that whichever data center has the later clock will
win. Every modification you make gets a time stamp (generally set by your client to the current
time, if you are using one). I believe that whatever modification happened with the last time
stamp is canonical. What would happen if you make conflicting changes with the exact same
time stamp? No idea.
> ----- Original Message -----
> From: "Eldad Yamin" <>
> To:
> Sent: Tuesday, August 2, 2011 8:58:23 PM
> Subject: Question about eventually consistent in Cassandra
> Hi,
> Let’s say that I have 2 datacenters, a key is changed on both of my
> datacenters in the exact same time (even in 1-2 seconds diff).
> Datacenter #1 add column "abc" with value X Datacenter #2 add column "abc"
> with value Y.
> What is the result of that situation?
> Is there any different if the changes will be made withing the same data
> center?
> Thanks!
> Eldad Yamin

View raw message