Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Error during truncate: Cannot achieve consistency level ALL

I'm using Cassandra 2.1.9 Keyspace

WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '4'}  AND durable_writes = true;

Now one node is down and i want to truncate one of the tables. How can i do it? I cannot start my 4th node now. How can i prevent such problem in future?

like image 987
Abhishek Agarwal Avatar asked Nov 24 '25 10:11

Abhishek Agarwal


1 Answers

Simple answer is that you need to have all nodes up to execute truncate command. Documentation states: Note: The consistency level must be set to ALL prior to performing a TRUNCATE operation. All replicas must remove the data.

If you really want to truncate table you will first have to decommission that downed node and remove it from the ring.

like image 110
Matija Gobec Avatar answered Nov 25 '25 23:11

Matija Gobec