Search code examples
javacassandrahector

Cassandra ConsistencyLevel rules


We are having problems with understanding the different between the QUORUM and TWO ConsistencyLevel rules. We have a cluster defined with 3 nodes, a NetworkTopologyStrategy, and a SimpleSnitch. If the ConsistencyLevel is set to Quorum for writes, there is no problem. If we set the ConsistencyLevel to TWO for write, the write fails.

I believe in this case the both ConsistencyLevels require 2 nodes to write to but one fails and one succeeds. Any ideas?


Solution

  • What error message do you see?

    What is your replication factor? This will affect the meaning of "quorum".

    With RF=1, QUORUM only writes to one node, for example, which might explain why it works when TWO fails. See http://www.ecyrd.com/cassandracalculator/ for a handy calculator (though it doesn't support the CL=TWO level).

    TWO and THREE are not intended for low RFs: see http://www.datastax.com/docs/0.7/consistency/index

    For specialized cases where the replication factor is higher than three, Cassandra provides consistency levels of TWO and THREE