You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Anthony John <ch...@gmail.com> on 2011/02/24 13:47:06 UTC

New thread for : How does Cassandra handle failure during synchronous writes

>>c. Read with CL = QUORUM. If read hits node1 and node2/node3, new data
that was written to node1 will be returned.

>>In this case - N1 will be identified as a discrepancy and the change will
be discarded via read repair

>>[Naren] How will Cassandra know this is a discrepancy?

Because at Q - only N1 will have the "new data" and other other nodes won't.
This lack of consistency on N! will be detected and repaired. The value that
meets Q - the values from N2-3 - will be returned.

HTH

Re: New thread for : How does Cassandra handle failure during synchronous writes

Posted by Ritesh Tijoriwala <ti...@gmail.com>.
thanks Narendra. I read again the wiki quote you pasted below and now it
does make sense. Cassandra's design behavior is to propagate the failed
write if it was ever written successfully to atleast one server. I was
having hard time trying to work around this but I guess I am starting to
think the other way.

Question - what patterns do applications employ to deal with this type of
problems? Is there a way to know that even though the write failed, it might
have been partially succeeded? It helps if there is a way to know this
otherwise I cannot think of how to deal with this type of scenario. Please
help.

Thanks,
Ritesh

On Thu, Feb 24, 2011 at 10:55 AM, Narendra Sharma <narendra.sharma@gmail.com
> wrote:

> You are missing the point. The coordinator node that is handling the
> request won't wait for all the nodes to return their copy/digest of data. It
> just wait for Q (RF/2+1) nodes to return. This is the reason I explained two
> possible scenarios.
>
> Further, on what basis Cassandra will know that the data on N1 is result of
> a failure? Think about it!!
>
> Also, take a look at http://wiki.apache.org/cassandra/API. Following is
> from Cassandra wiki:
> "Because the repair replication process only requires a write to reach a
> single node to propagate, a write which 'fails' to meet consistency
> requirements will still appear eventually so long at it was written to at
> least one node. With W and R both using QUORUM, the best consistency we can
> achieve is the guarantee that we will receive the same value regardless of
> which nodes we read from. However, we can still peform a W=QUORUM that
> "fails" but reaches one server, perform a R=QUORUM that reads the old value,
> and then sometime later perform a R=QUORUM that reads the new value."
>
> Hope this make things very clear!
>
>
>
>
> On Thu, Feb 24, 2011 at 4:47 AM, Anthony John <ch...@gmail.com>wrote:
>
>> >>c. Read with CL = QUORUM. If read hits node1 and node2/node3, new data
>> that was written to node1 will be returned.
>>
>> >>In this case - N1 will be identified as a discrepancy and the change
>> will be discarded via read repair
>>
>> >>[Naren] How will Cassandra know this is a discrepancy?
>>
>> Because at Q - only N1 will have the "new data" and other other nodes
>> won't. This lack of consistency on N! will be detected and repaired. The
>> value that meets Q - the values from N2-3 - will be returned.
>>
>> HTH
>>
>
>

Re: New thread for : How does Cassandra handle failure during synchronous writes

Posted by Narendra Sharma <na...@gmail.com>.
You are missing the point. The coordinator node that is handling the request
won't wait for all the nodes to return their copy/digest of data. It just
wait for Q (RF/2+1) nodes to return. This is the reason I explained two
possible scenarios.

Further, on what basis Cassandra will know that the data on N1 is result of
a failure? Think about it!!

Also, take a look at http://wiki.apache.org/cassandra/API. Following is from
Cassandra wiki:
"Because the repair replication process only requires a write to reach a
single node to propagate, a write which 'fails' to meet consistency
requirements will still appear eventually so long at it was written to at
least one node. With W and R both using QUORUM, the best consistency we can
achieve is the guarantee that we will receive the same value regardless of
which nodes we read from. However, we can still peform a W=QUORUM that
"fails" but reaches one server, perform a R=QUORUM that reads the old value,
and then sometime later perform a R=QUORUM that reads the new value."

Hope this make things very clear!



On Thu, Feb 24, 2011 at 4:47 AM, Anthony John <ch...@gmail.com> wrote:

> >>c. Read with CL = QUORUM. If read hits node1 and node2/node3, new data
> that was written to node1 will be returned.
>
> >>In this case - N1 will be identified as a discrepancy and the change will
> be discarded via read repair
>
> >>[Naren] How will Cassandra know this is a discrepancy?
>
> Because at Q - only N1 will have the "new data" and other other nodes
> won't. This lack of consistency on N! will be detected and repaired. The
> value that meets Q - the values from N2-3 - will be returned.
>
> HTH
>