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

Andres de la Peña commented on CASSANDRA-17150:
-----------------------------------------------

The proposed patch is based on an old patch by [~jasonstack] , with some 
additions by [~eduard.tudenhoefner]:
||PR||CI||
|[trunk|https://github.com/apache/cassandra/pull/1546]|[j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/1462/workflows/4ab5ec86-29c3-4f87-bd7b-8918b6ab3315]
 
[j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/1462/workflows/88b87a3f-25eb-4f04-aceb-df194fb29bc4]|

It adds a new guardrail for warning or failing write queries when the disk 
usage of the targeted replicas is over the thresholds defined in config. The 
calculation of disk usage includes the size of memtables that are about to be 
flushed, and the guardrail doesn't affect non-CQL writes, such as streamed 
sstables.

Each node runs a periodic task that calculates the local disk usage and whether 
it's over the threshold limits. This determines the state of the node, which 
can be {{{}NOT_AVAILABLE{}}}, {{{}SPACIOUS{}}}, {{STUFFED}} or {{{}FULL{}}}. 
This state, if changed, is propagated to the other nodes through a new 
{{{}ApplicationState.DISK_USAGE{}}}. When those states arrive to the other 
nodes, they cache them so every node has a map of endpoints to disk usage 
states. That map is used by coordinator nodes to evaluate if the replicas 
targeted by a write are spacious enough.

> Guardrails for disk usage
> -------------------------
>
>                 Key: CASSANDRA-17150
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17150
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Feature/Guardrails
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
>             Fix For: 4.x
>
>
> Add guardrails for disk usage establishing soft/hard limits on the percentage 
> of used disk space. For example:
> {code}
> # Warning threshold to warn when local disk usage exceeds threshold. Valid 
> values: (1, 100]
> # Defaults to -1 to disable.
> # disk_usage_percentage_warn_threshold: -1
> # Failure threshold to reject write requests if replica disk usage exceeds 
> threshold. Valid values: (1, 100]
> # Defaults to -1 to disable.
> # disk_usage_percentage_failure_threshold: -1
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to