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

Jeremiah Jordan edited comment on CASSANDRA-21517 at 9/3/26 7:39 PM:
---------------------------------------------------------------------

There is a bug.  Because enabled requires at least one value to be above 0 then 
the following valid configs do not work

https://github.com/thelastpickle/cassandra/blob/245b00965efc0f2b3a85a30ac65801c64788b0c3/src/java/org/apache/cassandra/db/guardrails/Threshold.java#L81-L87

* warn {{-1}}, fail {{0}} (fail when the value is greater than zero)
* warn {{0}}, fail {{-1}} (warn when the value is greater than zero)
* warn {{0}}, fail {{0}}

All of those result in the threshold being disabled.

The tests don't check enabled, so they don't see the issue.


was (Author: JIRAUSER308715):
There is a bug.  Because enabled requires at least one value to be above 0 then 
the following valid configs do not work

https://github.com/thelastpickle/cassandra/blob/245b00965efc0f2b3a85a30ac65801c64788b0c3/src/java/org/apache/cassandra/db/guardrails/Threshold.java#L81-L87

* warn {{-1}}, fail {{0}} (fail when the value is greater than zero)
* warn {{0}}, fail {{-1}} (warn when the value is greater than zero)
* warn {{0}}, fail {{0}}

All of those result in the threshold being disabled.

> Guardrail values of zero to mean literally zero
> -----------------------------------------------
>
>                 Key: CASSANDRA-21517
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21517
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Feature/Guardrails
>            Reporter: Michael Semb Wever
>            Assignee: Michael Semb Wever
>            Priority: Normal
>             Fix For: 6.0.x, 7.x
>
>         Attachments: ci_summary.html, results_details.tar.xz
>
>
> Guardrail values of -1 and 0 both mean unlimited.
> https://github.com/apache/cassandra/blob/cassandra-6.0/src/java/org/apache/cassandra/db/guardrails/MaxThreshold.java#L60
> This comes from CASSANDRA-17146 and appears to have been an oversight.
> This creates difficulties when you need finer control of the guardrails, like 
> not being able to configure "more than 0 is a warning" or "more than 0 is a 
> failure".
> For example, a typically recommended approach to secondary indexes would be as
> {code}
> # disable secondary_indexes
> secondary_indexes_total_fail_threshold = 0
> # disable sasi
> sasi_indexes_total_fail_threshold: 0
> # unlimited sai, but max ten per table
> sai_indexes_per_table_fail_threshold: 10
> sai_indexes_total_fail_threshold: -1
> {code}
> Discussion on the ticket happened here: 
> https://the-asf.slack.com/archives/CK23JSY2K/p1783960683402379 



--
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