HDDS-14925. Enhance DN Disk space management with soft and hard minfreespace limits.#10054
Open
ashishkumar50 wants to merge 4 commits intoapache:masterfrom
Open
HDDS-14925. Enhance DN Disk space management with soft and hard minfreespace limits.#10054ashishkumar50 wants to merge 4 commits intoapache:masterfrom
ashishkumar50 wants to merge 4 commits intoapache:masterfrom
Conversation
rakeshadr
reviewed
Apr 14, 2026
| minFreeSpaceRatio = HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT_DEFAULT; | ||
| } | ||
| if (minFreeSpaceHardLimitRatio > 1 || minFreeSpaceHardLimitRatio < 0) { | ||
| LOG.warn("{} = {} is invalid, should be between 0 and 1", |
Contributor
There was a problem hiding this comment.
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 " |
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
Please add @VisibleForTesting annotationhere . Its only used in UTs.
Note: Please add all the functions with the annotations, if its only used in tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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