Skip to content

HDDS-15446. Expose Hard Min Free Space Threshold via JMX#10575

Merged
sarvekshayr merged 2 commits into
apache:masterfrom
anuragp010:hdds-15446
Jun 24, 2026
Merged

HDDS-15446. Expose Hard Min Free Space Threshold via JMX#10575
sarvekshayr merged 2 commits into
apache:masterfrom
anuragp010:hdds-15446

Conversation

@anuragp010

@anuragp010 anuragp010 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The hard minimum free space threshold is not available via JMX on Datanodes. The write path rejection logic uses the hard threshold, which is exposed through the getFreeSpaceToSpare method on HddsVolume. This PR exposes the metric in JMX.

What is the link to the Apache JIRA

HDDS-15446

How was this patch tested?

  1. Unit test was updated.
  2. Tested Manually:
bash-5.1$ curl -XGET http://ozone-datanode-1:9882/jmx?qry=Hadoop:service=HddsDatanode,name=VolumeInfoMetrics-/data/hdds
{
  "beans" : [ {
    "name" : "Hadoop:service=HddsDatanode,name=VolumeInfoMetrics-/data/hdds",
    "modelerType" : "VolumeInfoMetrics-/data/hdds",
    "tag.Context" : "ozone",
    "tag.DatanodeUuid" : "5fa333c2-71a4-43bc-b95f-968a925cefa6",
    "tag.StorageType" : "DISK",
    "tag.VolumeType" : "DATA_VOLUME",
    "tag.StorageDirectory" : "/data/hdds/hdds",
    "tag.VolumeState" : "NORMAL",
    "tag.Hostname" : "3319dfbfbcbf",
    "AvailableSpaceInsufficient" : 0,
    "DbCompactLatencyNumOps" : 0,
    "DbCompactLatencyAvgTime" : 0.0,
    "NumContainerCreateRequestsInSoftBandMinFreeSpace" : 0,
    "NumContainerCreateRequestsRejectedHardMinFreeSpace" : 0,
    "NumScans" : 1,
    "NumScansSkipped" : 0,
    "NumWriteRequestsInSoftBandMinFreeSpace" : 0,
    "NumWriteRequestsRejectedHardMinFreeSpace" : 0,
    "ReservedCrossesLimit" : 1,
    "Committed" : 0,
    "LayoutVersion" : 1,
    "Containers" : 0,
    "OzoneCapacity" : 105076655700,
    "OzoneAvailable" : 91655196672,
    "OzoneUsed" : 4382720,
    "Reserved" : 10508716,
    "FilesystemCapacity" : 105087164416,
    "FilesystemAvailable" : 91655196672,
    "FilesystemUsed" : 13431967744,
    "MinFreeSpace" : 104857600,
    "HardMinFreeSpace" : 104857600,
    "NonOzoneUsed" : 13427585024
  } ]
}bash-5.1$
  1. DN UI shows the new metric:
image

@priyeshkaratha priyeshkaratha left a comment

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.

Thanks @anuragp010 for the patch and changes LGTM

@priyeshkaratha

Copy link
Copy Markdown
Contributor

@devmadhuu Can you review the changes?

@sarvekshayr sarvekshayr left a comment

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.

Thanks @anuragp010 for the patch.

private static final MetricsInfo HARD_MIN_FREE_SPACE =
Interns.info("HardMinFreeSpace",
"Minimum free space threshold (hard limit) enforced locally for writes, " +
"derived from hdds.datanode.volume.min.free.space.hard.limit.percent");

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.

Should we include hdds.datanode.volume.min.free.space in the HardMinFreeSpace metric description to match MinFreeSpace?
The limit is determined by the higher of the hdds.datanode.volume.min.free.space and the hdds.datanode.volume.min.free.space.hard.limit.percent values.

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.

Yes, better to mention that way

@sarvekshayr sarvekshayr merged commit d1905e1 into apache:master Jun 24, 2026
90 of 91 checks passed
@sarvekshayr

Copy link
Copy Markdown
Contributor

Thanks @anuragp010 for the patch and @priyeshkaratha for the review.

@anuragp010 anuragp010 deleted the hdds-15446 branch June 24, 2026 12:04
@anuragp010

Copy link
Copy Markdown
Contributor Author

@priyeshkaratha , @sarvekshayr thank you !

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