You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Guy Incognito <dn...@gmail.com> on 2012/02/01 21:33:12 UTC

read-repair?

how does read repair work in the following scenario?

i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, 
eg a timed-out write at quorum) node 1 has a 'new' version of the 
row/column (eg clock = 10), but node 2 and 3 have 'old' versions (clock 
= 5), when i try to read my row/column at quorum, what do i get back?

do i get the clock 5 version because that is what the quorum agrees on, 
and then read-repair kicks in and nodes 2 and 3 are updated to clock 10 
so a subsequent read returns clock 10?  or are nodes 2 and 3 updated to 
clock 10 first, and i get the clock 10 version on the initial read?

Re: read-repair?

Posted by Peter Schuller <pe...@infidyne.com>.
> sorry to be dense, but which is it?  do i get the old version or the new
> version?  or is it indeterminate?

Indeterminate, depending on which nodes happen to be participating in
the read. Eventually you should get the new version, unless the node
that took the new version permanently crashed with data loss prior to
the data making it elsewhere.

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)

Re: read-repair?

Posted by Guy Incognito <dn...@gmail.com>.
sorry to be dense, but which is it?  do i get the old version or the new 
version?  or is it indeterminate?

On 02/02/2012 01:42, Peter Schuller wrote:
>> i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, eg
>> a timed-out write at quorum) node 1 has a 'new' version of the row/column
>> (eg clock = 10), but node 2 and 3 have 'old' versions (clock = 5), when i
>> try to read my row/column at quorum, what do i get back?
> You either get back the new version or the old version, depending on
> whether node 1 was participated in the read. In your scenario, the
> prevoius write at quorum failed (since it only made it to one node),
> so this is not a violation of the contract.
>
> Once node 2 and/or 3 return their response, read repair (if it is
> active) will cause re-read and re-conciliation followed by a row
> mutation being send to the nodes to correct the column.
>
>> do i get the clock 5 version because that is what the quorum agrees on, and
> No; a quorum of node is waited for, and the newest column wins. This
> accomplish the reads-see-write invariant.
>


Re: read-repair?

Posted by Peter Schuller <pe...@infidyne.com>.
> i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, eg
> a timed-out write at quorum) node 1 has a 'new' version of the row/column
> (eg clock = 10), but node 2 and 3 have 'old' versions (clock = 5), when i
> try to read my row/column at quorum, what do i get back?

You either get back the new version or the old version, depending on
whether node 1 was participated in the read. In your scenario, the
prevoius write at quorum failed (since it only made it to one node),
so this is not a violation of the contract.

Once node 2 and/or 3 return their response, read repair (if it is
active) will cause re-read and re-conciliation followed by a row
mutation being send to the nodes to correct the column.

> do i get the clock 5 version because that is what the quorum agrees on, and

No; a quorum of node is waited for, and the newest column wins. This
accomplish the reads-see-write invariant.

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)