apache/cassandra · info
key ' ' is deprecated; should switch to
Error message
key '%s' is deprecated; should switch to '%s'
What it means
SettingsTable.data() warns when a partition key that is a backwards-compatible alias of a renamed configuration property is queried: "key '<name>' is deprecated; should switch to '<new name>'". The value is still served under the old name; the warning nudges users to the canonical settings-table key.
Solutions
- Use the new key from the warning message in subsequent queries.
- Update automation/scripts to the canonical setting names.
- Cross-check current names with SELECT name FROM system_views.settings to see all valid keys.
Example fix
// before SELECT * FROM system_views.settings WHERE name = 'old_property_name'; // after (use the suggested new key) SELECT * FROM system_views.settings WHERE name = 'new_property_name';
Defensive patterns
Strategy: validation
Validate before calling
// resolve the canonical key first
boolean known = session.execute("SELECT name FROM system_views.settings").all()
.stream().anyMatch(r -> r.getString("name").equals(desiredKey)); Prevention
- Discover valid keys with SELECT name FROM system_views.settings instead of hardcoding old names.
- Update scripts when config properties are renamed across versions.
- Treat deprecation warnings in driver output as TODOs.
When it happens
Trigger: SELECT ... FROM system_views.settings WHERE name = '<old-config-name>' (or a single-partition read of that row) where the name is in BACKWARDS_COMPATIBLE_NAMES after a config property was renamed.
Common situations: Ops scripts reading virtual settings by pre-rename cassandra.yaml property names after upgrading Cassandra; documentation using old keys like renamed compaction/commitlog settings.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- repair_session_max_tree_depth has been deprecated and…
- The " " virtual table is deprecated. Please, use either "…
- The " " virtual table is deprecated. Please, use…
- A repair_session_space of
- accord.journal_directory must not be the same as the…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/8fd0f6ca4deb73d8.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/db/virtual/SettingsTable.java:82
{
super(TableMetadata.builder(keyspace, "settings")
.comment("current settings")
.kind(TableMetadata.Kind.VIRTUAL)
.partitioner(new LocalPartitioner(UTF8Type.instance))
.addPartitionKeyColumn(NAME, UTF8Type.instance)
.addRegularColumn(VALUE, UTF8Type.instance)
.build());
this.config = config;
this.useJsonFormat = CassandraRelevantProperties.VIRTUAL_TABLE_COMPLEX_SETTINGS_FORMAT_JSON.getBoolean();
}
@Override
public DataSet data(DecoratedKey partitionKey)
{
SimpleDataSet result = new SimpleDataSet(metadata());
String name = UTF8Type.instance.compose(partitionKey.getKey());
if (BACKWARDS_COMPATIBLE_NAMES.containsKey(name))
ClientWarn.instance.warn("key '" + name + "' is deprecated; should switch to '" + BACKWARDS_COMPATIBLE_NAMES.get(name) + "'");
if (PROPERTIES.containsKey(name))
result.row(name).column(VALUE, getValue(PROPERTIES.get(name)));
return result;
}
@Override
public DataSet data()
{
SimpleDataSet result = new SimpleDataSet(metadata());
for (Map.Entry<String, Property> e : PROPERTIES.entrySet())
result.row(e.getKey()).column(VALUE, getValue(e.getValue()));
return result;
}
@VisibleForTesting
String getValue(Property prop)
{
Redacted maybeCredential = prop.getAnnotation(Redacted.class);View on GitHub (pinned to 88fd0f6a0e)