adelapena commented on code in PR #2246:
URL: https://github.com/apache/cassandra/pull/2246#discussion_r1158455966


##########
conf/cassandra.yaml:
##########
@@ -1757,6 +1757,12 @@ drop_compact_storage_enabled: false
 # Guardrail to allow/disallow user-provided timestamps. Defaults to true.
 # user_timestamps_enabled: true
 #
+# Guardrail to bound user-provided timestamps within a given range. Default is 
infinite (denoted by 0)

Review Comment:
   I think the convention for disables duration, sizes, etc. is that the 
disabled value is `null` instead of zero. 
   
   Note also that, even if we were considering zero as the disabled value, the 
following config will wrongly fail validation:
   ```java
   guardrails().setMaximumTimestampFailThreshold(0);
   guardrails().setMaximumTimestampWarnThreshold(1);
   ```
   That would fail because 0 is not consistently considered as the disabled 
value.
   
   I think we should use `null` as the disabled value for the `DurationSpec` 
properties. The `int` values in seconds that we use on the JMX methods can 
instead use `-1` as their disabled value. More or less [this 
way](https://github.com/adelapena/cassandra/commit/9b41030a609e4b1ef0ec23a04f339ea4dc021fce).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to