[ 
https://issues.apache.org/jira/browse/CASSANDRA-18617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17737404#comment-17737404
 ] 

dan jatnieks commented on CASSANDRA-18617:
------------------------------------------

Part of this change is to add converters that will take the old threshold 
value, including the number of system keyspaces/tables, and convert that to a 
guardrail value that excludes system keyspaces/tables.

To determine the number of system keyspaces, there is an existing 
{{SchemaConstants.getSystemKeyspaces}} method that seems reasonable to use.

However, I'm finding it harder to find an existing way to get the number of 
system tables.

Some test code uses {{metadata}} method in system keyspace classes to get 
metadata including the tables, e.g. {{{}SystemKeyspace.metadata{}}}. However, 
aside from maybe doing more work than is needed, this doesn't work when called 
from converter code because just accessing {{SystemKeyspace}} triggers static 
initialization, and at some point that leads to needing some value from 
{{{}DatabaseDescriptor{}}}. But the initialization of {{DatabaseDescriptor}} is 
what triggered the loading of the config in the first place (so it ends up with 
an NPE trying to access an uninitialized field).

So I think something is needed similar to {{getSystemKeyspaces}} also located 
in {{SchemaConstants}} where static initialization problems are less likely. A 
downside to this approach is that it depends on being updated whenever a new 
system table is added, but I supposed it's no worse than the existing situation 
with {{{}getSystemKeyspaces{}}}.

> Disable the deprecated keyspace/table thresholds and convert them to 
> Guardrails
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18617
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18617
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Feature/Guardrails
>            Reporter: dan jatnieks
>            Assignee: dan jatnieks
>            Priority: Normal
>             Fix For: 5.x
>
>
> The non-guardrail thresholds 'keyspace_count_warn_threshold' and 
> 'table_count_warn_threshold' configuration settings were first added with 
> CASSANDRA-16309 in 4.0-beta4 and have subsequently been deprecated since 
> 4.1-alpha in CASSANDRA-17195 when they were replaced/migrated to guardrails 
> as part of CEP-3 (Guardrails).
> These thresholds should now be removed from cassandra.yaml, while still 
> allowed in existing yaml files.
> The old thresholds will be disabled by removing their default values from 
> Config.java, and any existing values for these thresholds will be converted 
> to the new guardrails using the '@Replaces' tag on the corresponding 
> guardrail values.
> Since the old thresholds considered the number of system keyspace/tables in 
> their values, the '@Replaces' conversion will subtract the current number of 
> system tables from the old value and log a descriptive message.
> See dev list discussion: 
> https://lists.apache.org/thread/0zjg08hrd6xv7lhvo96frz456b2rvr8b



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to