Skip to content

Conversation

@Gargi-jais11
Copy link
Contributor

What changes were proposed in this pull request?

Currently it uses deltaSizes to record the pre-allocated and pre-deleted bytes of each volume due to there is selected container to move.

But deltaSizes is not aware by other activities, such as container creation, container moving command by container balancer. So there is chance that data volume will be over allocated due to this.

This task aims to use HddsVolume#committedBytes to replace deltaSizes, so that the space pre-allocated by disk balancer will be fully awared by HddsVolume.

What is the link to the Apache JIRA

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

How was this patch tested?

Passed existing tests.

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review April 21, 2025 04:06
# Conflicts:
#	hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/policy/DefaultVolumeChoosingPolicy.java
Copy link
Contributor

@chungen0126 chungen0126 left a comment

Choose a reason for hiding this comment

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

Thanks @Gargi-jais11 for the patch.

inProgressContainers.add(toBalanceContainer.getContainerID());
deltaSizes.put(sourceVolume, deltaSizes.getOrDefault(sourceVolume, 0L)
- toBalanceContainer.getBytesUsed());
deltaSizes.put(destVolume, deltaSizes.getOrDefault(destVolume, 0L)
Copy link
Contributor

@chungen0126 chungen0126 Apr 23, 2025

Choose a reason for hiding this comment

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

Since we are still using deltaSizes to choose volume, why not just keep this. But also increase committed bytes to avoid over allocated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're using deltaSizes to reflect space expected to be freed on the source volume (though not yet deleted), and committedBytes to reflect space already reserved on the destination volume (e.g., due to pending container moves). This ensures chooseVolume() to consider both volume committedBytes and deltaSize , one for destVolume and one for srcVolume.

inProgressContainers.remove(containerData.getContainerID());
deltaSizes.put(sourceVolume, deltaSizes.get(sourceVolume) +
containerData.getBytesUsed());
deltaSizes.put(destVolume, deltaSizes.get(destVolume)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor

@ChenSammi ChenSammi left a comment

Choose a reason for hiding this comment

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

Thanks @Gargi-jais11 , and @chungen0126 for the review.

@ChenSammi ChenSammi merged commit 73a813b into apache:HDDS-5713 Apr 25, 2025
42 checks passed
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