Cassandra : If parts of the cluster are completely disconnected from the whole, only the largest group of nodes can still satisfy queries

Viewed 139

As part of the Cassandra developer training from Datastax, I had the below question "In a full network partition, that is, parts of the cluster are completely disconnected from the whole, only the largest group of nodes can still satisfy queries."

I gave the answer as "YES" here. Because even though we break the Cassandra cluster, the largest group can still reset itself to satisfy the consistency level and serve the request.

But I see my answer was wrong. Can any one please explain me why ?

1 Answers

Because of that little thing we call "data."

The problem doesn't mention specific numbers of nodes that went down, or the replication factor (RF) that the keyspaces are defined with. Because of that, you have no guarantees whatsoever as to the specific token ranges (and replicas thereof) that could also be down. When in all likelihood, complete sets of data replicas are down in this case.

the largest group can still reset itself

I think I know what you mean here. When nodes are decomm'd or removed, the remaining nodes adjust their token range assignments to ensure 100% data coverage. That's true. However, the data associated with those ranges doesn't automatically move with them.

That doesn't happen until a repair operation is run. And if multiple nodes are down, (again) including complete sets of data replicas, you may not have the nodes you need to stream some of the data.

Example:

Say we have a 12 node cluster (in a single DC), keyspaces defined with RF=3, and the nodes become "split" into groups of 2 (group A), 3 (group B), and 7 (group C).

If group C is still serving queries, there will be some data partitions which originally:

  • Had all replicas in group C. These queries will still succeed.
  • Had 1 replica in group A or B. These queries will still succeed @ QUORUM or less, but will now fail at ALL.
  • Had 2 replicas in groups A or B (or both). These queries will still succeed @ ONE, but will now fail for all other consistency levels.
  • Had all data on nodes in both groups A and B. All queries for these partitions will fail.
  • Had all data on nodes in group B. All queries for these partitions will fail.
Related