Linearizability Violations in Cassandra
Let's examine two different scenarios where Cassandra violates the linearizability
We'll cover the following
It is important to note that operations on a single row are not linearizable by default, even when using majority quorums.
To understand why it is useful to learn how Cassandra handles partial failures and network delays. Let’s examine two different scenarios.
Without read repair
In this scenario, we assume that read repair is not used. The system consists of three different replicas with a single row that contains a single column owner
with the value none
.
Client A initially performs a write operation to set owner = A
. While this operation is in progress, two clients B and C perform a read operation for the owner in sequence. The majority quorum of client B contains one replica that has already received the write operation, while client C contacts a quorum with nodes that haven’t received it yet. As a result, client B reads owner = A
, while client C reads owner = none
even though the operation from the latter started after the operation from the former had been completed, which violates linearizability.
The following illustration shows this phenomenon:
Get hands-on with 1200+ tech skills courses.