Lets say I've created a keyspace and table:
CREATE KEYSPACE IF NOT EXISTS keyspace_rep_0
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 0};
CREATE TABLE IF NOT EXISTS some_table (
some_key ascii,
some_data ascii,
PRIMARY KEY (some_key)
);
I don't want any replica of this data. I can insert into this table with consistency level ANY
. But I couldn't select any data from this table.
I got the following errors when querying with consistency levels ANY
and ONE
, respectively:
message="ANY ConsistencyLevel is only supported for writes"
message="Cannot achieve consistency level ONE"
info={'required_replicas': 1, 'alive_replicas': 0, 'consistency': 1}
I've tried other read consistency levels but none of them worked for me.
This is very similar to choosing 'replication_factor': 1
and shutting down a node. Again I couldn't select any data. All read consistency levels require at least one replica to be up. Is this how Cassandra works? You cannot select data without replication? What am I missing?