Skip to content

HDDS-12928. datanode min free space configuration #8388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 28, 2025
Merged
Prev Previous commit
Next Next commit
test case fix
  • Loading branch information
sumitagrawl committed May 16, 2025
commit f07be0effec1fd4347b5caa8e4aa6452380830a2
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ public void testMinFreeSpaceCalculator() throws Exception {
assertEquals(minSpace, conf.getObject(DatanodeConfiguration.class).getMinFreeSpace(capacity));

conf.setFloat(HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT, 0.01f);
// When both are set, minSpace will be used
// When both are set, max(minSpace, %cent), minSpace will be used
assertEquals(minSpace, conf.getObject(DatanodeConfiguration.class).getMinFreeSpace(capacity));

// capacity * 1% = 10
conf.unset(HDDS_DATANODE_VOLUME_MIN_FREE_SPACE);
assertEquals(10, conf.getObject(DatanodeConfiguration.class).getMinFreeSpace(capacity));
conf.setFloat(HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT, 1f);
// When both are set, max(minSpace, %cent), hence %cent will be used
assertEquals(1000, conf.getObject(DatanodeConfiguration.class).getMinFreeSpace(capacity));
}

private long getExpectedDefaultReserved(HddsVolume volume) {
Expand Down