1

I understand while writing data on network topology cassandra writes replica as per rack.

  1. when we decommission a node, does the data of node is sttreamed as per logical rack with token distribution?
  2. what would be the quorum of cluster with 5 nodes and 3 replica with 3 datacenter? Is it two node down in a cluster or 2 node down from seperate rack brings down the cluster?
1

2 Answers 2

1

When there is more than one logical rack configured in a data centre, Cassandra will place copies of the data (replicas) on distinct racks by "walking" around the Cassandra ring clockwise until it reaches a neighbouring node that is on another rack than the last replica.

The same thing applies when a node is decommissioned. Cassandra will attempt to stream the decommissioning node's data to the same rack if possible. Otherwise, the data will be streamed to its neighbour (next node in the ring to its right).

When talking about consistency levels, it isn't quite right to think about nodes being down. What is important is whether the replicas are unavailable, not necessarily the nodes because an unavailable node which is not a replica for a given request does not have any impact to the required consistency level. Cheers!

0

What would be the quorum of cluster with 5 nodes and 3 replica with 3 datacenter? Is it two node down in a cluster or 2 node down from seperate rack brings down the cluster?

I'll answer this one. It all depends on the consistency level that the queries are run at.

Let's go with a hypothetical situation: 3 data centers (DC), 6 nodes in each DC, 3 racks in each DC with 2 nodes in each rack, and a keyspace defined similar to this:

CREATE KEYSPACE WITH REPLICATION={'class':'NetworkTopologyStrategy',
    'dc1':'3', 'dc2':'3', 'dc3':'3'};

If an application is querying dc2 at a consistency of LOCAL_QUORUM, then with three replicas in dc2, quorum == two. So in this situation, you're ok with one node going down. You could even lose an entire rack (two nodes), because Cassandra will make sure that multiple data replicas are not put into the same rack. But with two nodes from different racks down, you can no longer guarantee quorums in that DC.

Now let's say that you're querying dc2 at a consistency of LOCAL_ONE. Now the application only waits for a response from one replica, so quorum doesn't matter. In this situation, you can have two nodes go down and still serve queries. In fact, you could lose two whole racks (four nodes) in dc2 and still serve queries, because Cassandra will make sure that multiple data replicas are not put into the same rack. In this scenario, as long as you have one rack at 100% up, you're ok.

One final scenario. Same topology, but querying at QUORUM (no "local"). As the app isn't "sticky" to a single DC, the total RF of all DCs is calculated at nine, your application will wait for a response from five replicas from any DC.

As long as the application gets those responses, you're ok. However, this incurs cross-DC traffic which is almost always slow, so it's not recommended. And you're now waiting for five local and remote responses instead of two local responses, so it's not going to be fast.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.