When the down data center comes back up, the Quorum reads will result in a 
read-repair, so you will get valid data.   Besides that, hinted handoff will 
take care of getting data replicated to a previously down node.

You're example is a little unrealistic because you could theoretically have a 
DC with only one node.  So CL.ONE would work every time.   But if you have more 
than 1 node, you have to decide if your application can tolerate getting "NULL" 
 for a read if the write hasn't propagated from the responsible node to the 
replica.

disclaimer:  I'm a cassandra novice.

On Apr 12, 2011, at 5:12 PM, Raj N wrote:

> Hi experts,
>      We are planning to deploy Cassandra in 2 datacenters. Let assume there 
> are 3 nodes, RF=3, 2 nodes in 1 DC and 1 node in 2nd DC. Under normal 
> operations, we would read and write at QUORUM. What we want to do though is 
> if we lose a datacenter which has 2 nodes, DC1 in this case, we want to 
> downgrade our consistency to ONE. Basically I am saying that whenever there 
> is a partition, then prefer availability over consistency. In order to do 
> this we plan to catch UnavailableException and take corrective action. So try 
> QUORUM under normal circumstances, if unavailable try ONE. My questions -
> Do you guys see any flaws with this approach? 
> What happens when DC1 comes back up and we start reading/writing at QUORUM 
> again? Will we read stale data in this case?
> 
> Thanks
> -Raj

Reply via email to