-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-12431. [DiskBalancer] Use committedBytes to reserve the space pre-allocated for container #8297
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
Conversation
1e6a23f to
8713702
Compare
...ervice/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java
Outdated
Show resolved
Hide resolved
# Conflicts: # hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/policy/DefaultVolumeChoosingPolicy.java
8713702 to
2ef1a6b
Compare
1baf681 to
88ab23c
Compare
...ervice/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java
Outdated
Show resolved
Hide resolved
2bef754 to
d461c12
Compare
chungen0126
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
...ervice/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java
Outdated
Show resolved
Hide resolved
db997f6 to
f483261
Compare
ChenSammi
left a comment
There was a problem hiding this 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.
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.