incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shankarpnsn <>
Subject Re: What does ReadRepair exactly do?
Date Wed, 24 Oct 2012 15:28:32 GMT
Hiller, Dean wrote
> I guess one more thing is I completely ignore your second write mainly
> because I assume it comes after we already read so your let's say you
> current state is
> node1 = val1 node2 = val1 node3 = val1
> You do a write quorom of val=2 which is IN the middle!!!
> node1 = val1 node2 = val2 node3 = val1  (NOTICE the write is not complete
> yet)
> If you read from node1 and node3, you get val1.  If you read from node1
> and node2, you get val2 as a read repair will happen.
> Ie. You always get the older value or newer value.
> If you have two writes come in like so
> node1 = val1 node2 = val2 and node3= val3
> Well, I think you can figure it out when you do a read ;).  If your read
> quorum reads from node1 and node3 , you get val3, etc. etc.
> This is basically how it works….If your scenario is a web page, a user
> simply hits the refresh button and sees the values changing. I'm extending
> your example 
> Later,
> Dean

Thanks for the example Dean. This definitely clears things up when you have
an overlap between the read and the write, and one comes after the other.
I'm still missing, how read repairs behave. Just extending your example for
the following case: 

1. node1 = val1 node2 = val1 node3 = val1

2. You do a write operation (W1) with quorom of val=2
node1 = val1 node2 = val2 node3 = val1  (write val2 is not complete yet)

3. Now with a read (R1) from node1 and node2, a read repair will be
initiated that needs to write val2 on node 1.  
node1 = val1; node2 = val2; node3 = val1  (read repair val2 is not complete

4. Say, in the meanwhile node 1 receives a write val 4; Read repair for R1
now arrives at node 1 but sees a newer value val4.
node1 = val4; node2 = val2; node3 = val1  (write val4 is not complete, read
repair val2 not complete)

In this case, for read R1, the value val2 does not have a quorum. Would read
R1 return val2 or val4 ? 

Zhang, Manu wrote
> And we don't send read request to all of the three replicas (R1, R2, R3)
> if CL=QUOROM; just 2 of them depending on proximity

Thanks Zhang. But, this again seems a little strange thing to do, since one
(say R2) of the 2 close replicas (say R1,R2) might be down, resulting in a
read failure while there are still enough number of replicas (R1 and R3)
live to satisfy a read. 

View this message in context:
Sent from the mailing list archive at

View raw message