incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morton <aa...@thelastpickle.com>
Subject Re: What if write consistency level cannot me met ?
Date Tue, 15 Feb 2011 20:54:00 GMT
Here's my understanding....

The request will not start if CL nodes are not up from the point of view of the coordinator
(when considering a single mutation). I the case described where the CL is ALL, the write
would not start and UnavailableException would be thrown. This comes from IWriteResponseHandler.assureSufficientNodes()
. Same thing happens on reads, we're not going to start a request we know cannot succeed.

if CL nodes are up and the write starts, but less then CL nodes return by rpc_timeout the AbstractWriteResponseHandler
( or ReadCallback for reads) will raise a TimeoutException,  o.a.c.t.CassandraServer is will
catch this and turn it into the thrift TimedoutException. 

So in general:
- UnavailableException means the request could not start (insufficient CL, or node bootstrapping
or any node down when doing schema ops)
- TimedoutException means we started and timed out. 

In both cases you can retry. 

Aaron


On 16 Feb, 2011,at 09:11 AM, Matthew Dennis <mdennis@datastax.com> wrote:

But you can not depend on such behavior.  If you do a write and you get an unavailable exception,
the only thing you know is at that time it was not able to be placed on all the nodes required
to meet your CL.  It may eventually end up on all those nodes, it may not be on any of the
nodes or at the time you read the reply it could be on some subset of the nodes.  Regardless
of the outcome, it is safe to retry.

On Tue, Feb 15, 2011 at 2:00 PM, Aaron Morton <aaron@thelastpickle.com> wrote:
The write will not start if there are insufficient nodes up. In this case (All cl) you would
get an error and nothing would be committed to disk. You would get an Unavailable exception.

Aaron


On 16/02/2011, at 7:46 AM, Thibaut Britz <thibaut.britz@trendiction.com> wrote:

> Your write will fail. But if the write has reached  at least one node,
> it will eventually reach all the other nodes as well. So it won't
> rollback.
>
>
> On Tue, Feb 15, 2011 at 7:38 PM, A J <s5alye@gmailcom> wrote:
>> Say I set write consistency level to ALL and all but one node are down. What
>> happens to writes ? Does it rollback from the live node before returning
>> failure to client ?
>> Thanks.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
    • Unnamed multipart/related (inline, None, 0 bytes)
View raw message