0

I'm trying to connect my java spring boot application to cassandra astra db with the cql proxy running with docker-compose. I got this error :

com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Provided value LOCAL_ONE is not allowed for Write Consistency Level (disallowed values are: [ANY, ONE, LOCAL_ONE])

How to resolve this error please

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
alia
  • 163
  • 3
  • 12
  • Does this answer your question? [Consistency level LOCAL\_ONE is not supported for this operation. Supported consistency levels are: LOCAL\_QUORUM](https://stackoverflow.com/questions/62266181/consistency-level-local-one-is-not-supported-for-this-operation-supported-consi) – Kon May 30 '23 at 20:19

1 Answers1

0

As per the Astra DB Guardrails the supported consistency levels are:

Supported consistency levels: Reads: Any supported consistency level is permitted. Single-region writes: LOCAL_QUORUM and LOCAL_SERIAL

Multi-region writes: EACH_QUORUM and SERIAL

You need to use local_quorum for the writes as a minimum, one / local_one is not supported.

Andrew
  • 26,629
  • 5
  • 63
  • 86
  • Can I define the consistency level on my docker-compose.yml file? – alia May 31 '23 at 09:41
  • No, Astra DB has specific guardrails - even for a locally deployed Cassandra / DSE cluster, the consistency level is a facet of the application configuration / choices, and not the cluster choice. – Andrew May 31 '23 at 09:51
  • I set the value to local_quorum, I can insert just two entries but when I try to isert the third entry, I get this error: com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S – alia Jun 01 '23 at 19:47
  • @alia - please create another question with the details, stack trace, code sample etc. – Andrew Jun 01 '23 at 20:12