I think this jira

https://issues.apache.org/jira/browse/CASSANDRA-9895

Answer my question

Saludos

Jean Carlo

"The best way to predict the future is to invent it" Alan Kay



On Fri, Apr 12, 2019 at 10:04 AM Jean Carlo <jean.jeancarl48@gmail.com> wrote:
Hello Sean

Well this is a little bit confusing. After digging into the doc, I found this old documentation of Datastax that says
"First, we can dynamically adjust behavior depending on the cluster size and arrangement. Cassandra prefers to perform batchlog writes to two different replicas in the same datacenter as the coordinator."

Which may explain the message in the timeout. However I do not know if this information is still true. Someone know if this is still true?

Reading the comments in https://issues.apache.org/jira/browse/CASSANDRA-9620 that says ' Writing the batch log will always be done using CL ONE.' Contradict what I understood from datastax's doc

Yes I understood batches are not for speed. Still we are using it for a consistency need.

@Mahesh Yes we do set the consistency like that

Thank you

Jean Carlo

"The best way to predict the future is to invent it" Alan Kay



On Thu, Apr 11, 2019 at 3:39 PM Durity, Sean R <SEAN_R_DURITY@homedepot.com> wrote:

https://issues.apache.org/jira/browse/CASSANDRA-9620 has something similar that was determined to be a driver error. I would start with looking at the driver version and also the RetryPolicy that is in effect for the Cluster. Secondly, I would look at whether a batch is really needed for the statements. Cassandra batches are for atomicity – not speed.

 

Sean Durity

Staff Systems Engineer – Cassandra

MTC 2250

#cassandra - for the latest news and updates

 

 

From: Mahesh Daksha <dakshme@gmail.com>
Sent: Thursday, April 11, 2019 5:21 AM
To: user@cassandra.apache.org
Subject: [EXTERNAL] Re: Getting Consistency level TWO when it is requested LOCAL_ONE

 

Hi Jean,

 

I want to understand how you are setting the write consistency level as LOCAL ONE. That is with every query you mentioning consistency level or you have set the spring cassandra config with provided consistency level.

Like this:

cluster.setQueryOptions(new QueryOptions().setConsistencyLevel(ConsistencyLevel.valueOf(cassandraConsistencyLevel)));

 

The only possibility i see of such behavior is its getting overridden from some where.

 

Thanks,

Mahesh Daksha

 

On Thu, Apr 11, 2019 at 1:43 PM Jean Carlo <jean.jeancarl48@gmail.com> wrote:

Hello everyone,

 

I have a case where the developers are using spring data framework for Cassandra. We are writing batches setting consistency level at LOCAL_ONE but we got a timeout like this

 

Caused by: com.datastax.driver.core.exceptions.WriteTimeoutException: Cassandra timeout during BATCH_LOG write query at consistency TWO (2 replica were required but only 1 acknowledged the write)

 

Is it Cassandra that somehow writes to the system.batchlog using consistency TWO or is it spring data that makes some dirty things behind the scenes ?

(I want to believe it is the second one)

 

Cheers

 

Jean Carlo


"The best way to predict the future is to invent it" Alan Kay




The information in this Internet Email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Email are subject to the terms and conditions expressed in any applicable governing The Home Depot terms of business or client engagement letter. The Home Depot disclaims all responsibility and liability for the accuracy and content of this attachment and for any damages or losses arising from any inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other items of a destructive nature, which may be contained in this attachment and shall not be liable for direct, indirect, consequential or special damages in connection with this e-mail message or its attachment.