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

Stefan Miklosovic commented on CASSANDRA-17150:
-----------------------------------------------

I ve left the comment here: 
https://github.com/apache/cassandra/pull/1546/files#r844020636

One more observation, while I was trying to test this locally, what I realised 
is that it is quite hard to do in "laboratory environment". If you are 
inserting data into a node, it will go first to commit logs. From 
cassandra.yaml I read:

{code}
# Total space to use for commit logs on disk.
#
# If space gets above this value, Cassandra will flush every dirty CF
# in the oldest segment and remove it.  So a small total commitlog space
# will tend to cause more flush activity on less-active columnfamilies.
#
# The default value is the smaller of 8192, and 1/4 of the total space
# of the commitlog volume.
#
# commitlog_total_space: 8192MiB
{code}

Speaking out my mind here, lets say you have 1 hard drive where all data are 
(commit logs included). This is by default 8GB and it might happen that nothing 
will be flushed until it is full and if you have your disk like 5GiB and you 
set your thresholds to 80% to warn or fail on 4GB, will it? I think it will, 
because it will compute how much space there is left and that computation will 
just look how much space is free, not looking whether data are commit logs or 
sstables.

Also, this code: 

{code}
        for (Directories.DataDirectory dir : dataDirectoriesSupplier.get())
        {
            used = used.add(BigDecimal.valueOf(dir.getSpaceUsed()));
            total = total.add(BigDecimal.valueOf(dir.getTotalSpace()));
        }
{code}

It works with the assumption that all my data directories are on a separate 
partition. I can have, /data/cassandra/{data1,data2,data3} on one partition, so 
this logic would be broken.

> 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
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> 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