Double Infinity
Double Infinity

Reputation: 255

Why set Consistency to ALL before Truncate table

According to docs from datastax, it's good to use the cqlsh CONSISTENCY command to set the consistency level to ALL. I saw same recommendation from many other places. But why should we do that? Especially, in native protocol specification from apache-cassandra, it seems truncate query would ignore the consistency we set before.

Upvotes: 0

Views: 335

Answers (1)

Chris Lohfink
Chris Lohfink

Reputation: 16400

The truncate command requires all nodes up and it will fail preemptively if anything is down regardless of consistency level. You are right that you don't need to do that.

Also CQL truncate no longer uses JMX at all (blurb at bottom), that was from thrift days before cql3 so it might be just old documentation that hasn't been updated.

Upvotes: 2

Related Questions