Quorum Configuration

There are only two configurations that are currently recommended:

Quorum within a single datacenter (default):

connect = \
# ...other connect parameters... \
read_consistency=local-quorum \
write_consistency=local-quorum \
delete_consistency=local-quorum

Local-quorum guarantees that reads after writes are always returning the latest data. Dovecot requires strong consistency within a datacenter.

Quorum within multiple datacenters:

connect = \
# ...other connect parameters... \
read_consistency=local-quorum \
#read_fallback_consistency=quorum \
write_consistency=each-quorum \
write_fallback_consistency=local-quorum \
delete_consistency=each-quorum \
delete_fallback_consistency=local-quorum

As long as the datacenters are talking to each other, this uses each-quorum for writes. If there’s a problem, Cassandra nodes fallback to local-quorum and periodically try to switch back to each-quorum.

Using read_fallback_consistency=quorum allows reads to succeed even in cases when multiple Cassandra nodes have failed in the local datacenter. If the latency between datacenters is low enough, this may be a good option. It reduces problems that may happen during a split brain or site failover.

If Cassandra server returns a failure to query either

  1. because there aren’t enough nodes available for the consistency level, or
  2. because of Cassandra server timed out connecting all the necessary nodes, Dovecot attempts the query again using the fallback consistency.

It also switches all the following queries to use the fallback consistency for a while. It will be switched back when a query with the primary consistency level succeeds.

The queries are periodically retried with primary consistency level. The initial retry happens after 50 ms and the retries are doubled until they reach the maximum of 60 seconds.