question

Daniel avatar image
Daniel asked Erick Ramirez commented

How do I reset replication settings for system_traces?

I was growing a LAB single node cluster to a two node cluster and inadvertently altered system_traces replication factor from local:

DESC keyspace system_traces;
CREATE KEYSPACE system_traces WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '0'} AND durable_writes = true;

Now I cannot change it back to local neither drop the keyspace and recreate correctly.

cassandra@cqlsh> alter KEYSPACE system_traces WITH replication = {'class': 'LocalStrategy'} AND durable_writes = true;
ConfigurationException: <ErrorMessage code=2300 [Query invalid because of configuration issue] message="Unable to use given strategy class: LocalStrategy is reserved for internal use.">
cassandra@cqlsh> drop keyspace system_traces;
Unauthorized: code=2100 [Unauthorized] message="Cannot DROP <keyspace system_traces>"

How to revert/ reset this ?

replication
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

I think you've confused yourself. By default, the system_traces keyspace is configured with simple replication strategy and 2 replicas (even for single-node clusters):

system_traces WITH replication = {
    'class': 'SimpleStrategy',
    'replication_factor': '2'
};

As the error states, it is not possible to run DDL commands that reference the local replication strategy and by extension, it is also not possible to change the replication settings on keyspaces configured with the local strategy.

For reference, the only two system keyspaces which are configured with local strategy are:

CREATE KEYSPACE system WITH replication = {'class': 'LocalStrategy'};
CREATE KEYSPACE system_schema WITH replication = {'class': 'LocalStrategy'};

Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Daniel avatar image Daniel commented ·

You may be right... that would explain why it was picked up for change and if you are correct "it is also not possible to change the replication settings on keyspaces configured with the local strategy." I was able to change it.

Still could this be version dependent or have changed behavior from versions ?

Running and old one, 2.1.22.

Thank you,

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ Daniel commented ·
No, because if it was it would be a bug. Cheers!
0 Likes 0 ·