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: WriteTimeoutException on Lightweight transactions
Date Tue, 24 Dec 2013 03:17:46 GMT
Some background….

http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0

You can also get a timeout during the prepare phase, well anytime you are waiting on other
node really. The WriteTimeoutException returned from the server includes a writeType (https://github.com/apache/cassandra/blob/cassandra-2.0.0-beta1/src/java/org/apache/cassandra/exceptions/WriteTimeoutException.java#L27)
that will say if it CAS during the prepare and propose phases and simple when trying to commit.


it’s also on the WriteTimeoutException in the driver. if it says CAS then we did not get
to start the write.

Cheers

-----------------
Aaron Morton
New Zealand
@aaronmorton

Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com

On 20/12/2013, at 10:05 am, Demian Berjman <dberjman@despegar.com> wrote:

> Hi. I am using Cassandra 2.0.3 with Datastax Java client.
> 
> I execute an insert query:
> 
> Insert insert = QueryBuilder.insertInto("demo_cl","demo_table").value("id", id).value("col1",
"transactions").ifNotExists();
> 
> session.execute(insert.setConsistencyLevel(ConsistencyLevel.QUORUM);
> 
> Then, i force a shutdown on one node and get:
> 
> com.datastax.driver.core.exceptions.WriteTimeoutException: Cassandra timeout during write
query at consistency SERIAL (2 replica were required but only 1 acknowledged the write)
> 
> Then i read the row and i got not results. It seems that it was not inserted. What happened
to the "1 acknowledged the write"? It's lost? It's like a rollback?
> 
> Thanks,


Mime
View raw message