4

I have a table named buddyme.chatarch.

When trying to truncate the table.

cqlsh:buddyme> TRUNCATE chatarch;

I am getting this error.

TruncateError: <ErrorMessage code=1003 [Error during truncate] message="Error during truncate: Cannot achieve consistency level ALL">

What can be the possible reason? I am new to Cassandra.

Thanks

Vinod Patel
  • 430
  • 1
  • 7
  • 19

2 Answers2

8

Even I was facing the same issue. One of the nodes in my cluster was down. Fixed the issue by starting all nodes.

2

Even though All the 3 nodes in the cluster are up but still facing same issue. It was resolved after following as below

A TRUNCATE statement results in the immediate, irreversible removal of all data in the named table. Note: The consistency level must be set to ALL prior to performing a TRUNCATE operation. All replicas must remove the data.

Examples

Set the consistency level to ALL first. TRUNCATE or TRUNCATE TABLE can be used to remove all data from a named table. CONSISENTENCY ALL; TRUNCATE user_activity;

CONSISTENCY ALL; TRUNCATE TABLE menu_item;

Follow the link: https://docs.datastax.com/en/cql/3.1/cql/cql_reference/truncate_r.html

Raghavan
  • 313
  • 2
  • 10