diff --git a/src/java/org/apache/cassandra/config/GuardrailsOptions.java b/src/java/org/apache/cassandra/config/GuardrailsOptions.java index 54b88b6926..e8c82dacd9 100644 --- a/src/java/org/apache/cassandra/config/GuardrailsOptions.java +++ b/src/java/org/apache/cassandra/config/GuardrailsOptions.java @@ -996,12 +996,13 @@ public class GuardrailsOptions implements GuardrailsConfig x -> config.data_disk_usage_percentage_fail_threshold = x); } - + @Override public boolean getDataDiskUsageKeyspaceWideProtectionEnabled() { return config.data_disk_usage_keyspace_wide_protection_enabled; } + @Override public void setDataDiskUsageKeyspaceWideProtectionEnabled(boolean enabled) { updatePropertyWithLogging("data_disk_usage_keyspace_wide_protection_enabled", diff --git a/src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java b/src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java index c0ff7b34fe..b77a31ff42 100644 --- a/src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java +++ b/src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java @@ -436,6 +436,19 @@ public interface GuardrailsConfig */ int getDataDiskUsagePercentageFailThreshold(); + /** + * @return Whether a single node replicating a given keyspace being full should block writes for the entire + * keyspace. Returns {@code true} if this behavior is enabled, {@code false} otherwise. + */ + boolean getDataDiskUsageKeyspaceWideProtectionEnabled(); + + /** + * Enables or disables blocking writes for a keyspace when any node replicating that keyspace is full. + * + * @param enabled {@code true} to block writes keyspace-wide once a replica is full, {@code false} to disable. + */ + void setDataDiskUsageKeyspaceWideProtectionEnabled(boolean enabled); + /** * @return The max disk size of the data directories when calculating disk usage thresholds, {@code null} means * disabled.