Skip to content

HDDS-14925. Enhance DN Disk space management with soft and hard minfreespace limits.#10054

Open
ashishkumar50 wants to merge 4 commits intoapache:masterfrom
ashishkumar50:HDDS-14925
Open

HDDS-14925. Enhance DN Disk space management with soft and hard minfreespace limits.#10054
ashishkumar50 wants to merge 4 commits intoapache:masterfrom
ashishkumar50:HDDS-14925

Conversation

@ashishkumar50
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

DN will report soft + hard limit to SCM, and DN while allocating a new container or during write chunk it should allow up to hard limit.
Default use 25%(of hard limit) as soft limit.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14925

How was this patch tested?

Unit and Integration tests

minFreeSpaceRatio = HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT_DEFAULT;
}
if (minFreeSpaceHardLimitRatio > 1 || minFreeSpaceHardLimitRatio < 0) {
LOG.warn("{} = {} is invalid, should be between 0 and 1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the log message with default value.

LOG.warn("{} = {} is invalid, should be between 0 and 1; resetting to default {}",
          HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_HARD_LIMIT_PERCENT,
          minFreeSpaceHardLimitRatio,
          HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_HARD_LIMIT_PERCENT_DEFAULT);

HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_HARD_LIMIT_PERCENT_DEFAULT;
}
if (minFreeSpaceHardLimitRatio > minFreeSpaceRatio) {
LOG.warn("{} = {} is greater than {} = {}. SCM-reported spare will match the "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the log message and sets hard limit to soft limit

LOG.warn("{} = {} must not exceed {} = {}, setting hard limit to soft limit. "
        + "Set hard.limit.percent <= min.free.space.percent to enable the soft band.",
    HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_HARD_LIMIT_PERCENT,
    minFreeSpaceHardLimitRatio,
    HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT,
    minFreeSpaceRatio);

minFreeSpaceHardLimitRatio = minFreeSpaceRatio;

* hard-limit threshold only; there is no soft band until ratios are fixed.</p>
*/
public long getMinFreeSpace(long capacity) {
if (minFreeSpaceHardLimitRatio > minFreeSpaceRatio) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing this review comment, this if conditional check is no longer needed.

* 2% reported (40GB) and 1.5% hard (30GB), this is 10GB — the gap where the DN may send
* close-container actions while writes still succeed.
*/
public long getSoftBandMinFreeSpaceWidth(long capacity) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @VisibleForTesting annotationhere . Its only used in UTs.

Note: Please add all the functions with the annotations, if its only used in tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants