Yes, it can occur, if you allow it to occur.

Clients should send their own timestamps. Clocks should be synchronized. 
Failure to do so while relying on ‘last write wins’ timestamp resolution will 
cause undesirable results. 

This is unrelated to strong/weak/eventual consistency discussions or 
consistency level. 


From:  ibrahim El-sanosi
Reply-To:  "user@cassandra.apache.org"
Date:  Sunday, September 6, 2015 at 4:28 AM
To:  "user@cassandra.apache.org"
Subject:  Is Cassandra really Strong consistency?

Hi folks,

Assume we have 4-nodes cluster N1, N2, N3, and N4 and replication factor is 3.  
When write CL =ALL and read CL=ONE:

Client c1 sends W1 = [k1,V1] to N1 (a coordinator).  A coordinator (N1) 
generates timestamp Mon 05-09-2015 11:30:40,200 (according to its local clock) 
and assigned it to W1 and sends the W1 to N2, N3, and N4. After few seconds, 
Client c2 sends W2 = [K1, V2] to N4 (a coordinator). A coordinator (N4) 
generates timestamp Mon 05-09-2015 11:30:38,200 (according to its local clock, 
but assume here N4 clock a bit behind, nearly 2 seconds) and assigned it to W2 
and sends the W2 to N2, N3, and N4 (itself). 

As we have write CL =ALL and read CL = ONE. Now, Client c2 wants to read K1, 
connects to a coordinator N1, a coordinator sends read K1 to N2, picking latest 
timestamp which is [K1, V1]:Mon 05-09-2015 11:30:40,200.

So in this scenario, the latest data that wrote to the replicas is [K1, V2] 
which should be the correct one, but it reads [K1,V1] because of divert clock. 


Can such scenario occur?

Thank you 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to