Removed DC2 from replication but still able query date from DC2 nodes

Viewed 30

I am trying to remove a DC2 from my Cassandra Cluster. For this I start with altering replication factor from 2 to 0 in DC2. I try to insert a row in DC1 node1 and I am still receiving this row while queried from DC2 nodes. Why is this happening?

1 Answers

I'm assuming that you're querying the data with cqlsh. By default, it uses a consistency of ONE so it will query any replica. In your case, they all happen to be in DC1.

If you try to query with a local consistency then you will probably get the result (or lack of) which I think you're expecting.

As a side note, although setting replication to 0 is technically valid, it is more customary to simply remove a DC completely from replication so you end up with:

ALTER KEYSPACE some_ks WITH REPLICATION = { \
   'class' : 'NetworkTopologyStrategy', \
   'DC1' : 3
}
Related