zhianABCD
zhianABCD

Reputation: 223

ResponseError: Not enough replicas available for query at consistency SERIAL (2 required but only 1 alive)

I am a newcomer for Cassandra, current I met an issue, my cassandra setup as following,

  1. 1 DC, 1 Cluster
  2. 3 Nodes.
  3. SimpleStrategy
  4. durable write : true
  5. Replication factor : 2 when creating keyspace.
  6. Use IF NOT EXISTS to insert data into table.
  7. Seed node: 2 of them

Then I bring down one seed node, and I got the following error:

ResponseError: Not enough replicas available for query at consistency SERIAL (2 required but only 1 alive)

Upvotes: 1

Views: 2869

Answers (2)

adutra
adutra

Reputation: 4526

That's normal, SERIAL requires a Paxos transaction with a quorum of replicas. For RF 2, the quorum is 2; iow, you cannot tolerate any node down to write at SERIAL to a keyspace with RF 2.

Rule of thumb: don't use RF 2, it's useless. Your quorum is: (2/2)+1 = 2, but for RF 3, it's the same quorum. So you should always prefer RF 3. If you change your keyspace to RF 3, your application would be able to write at SERIAL even if one replica is down.

Also see https://www.ecyrd.com/cassandracalculator/

Upvotes: 2

LetsNoSQL
LetsNoSQL

Reputation: 1538

As per understanding Consistency serial is equivalent to QUORUM.You have RF=2 in 3 node cluster so data in Cassandra inserted based on hash. so when you have inserted the data into the cluster, data may be inserted on both seed nodes.So when you are retrieving the data with one seed node down you can get this error as cluster is not achieving the desired consistency level. Please refer link for more details. https://docs.datastax.com/en/ddac/doc/datastax_enterprise/dbInternals/dbIntConfigSerialConsistency.html

Upvotes: 0

Related Questions