Skip to content
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

HDDS-12565. VolumeUsage#hasVolumeEnoughSpace should treat volumeFreeSpaceToSpare as reserved space #8086

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peterxcli
Copy link
Contributor

@peterxcli peterxcli commented Mar 15, 2025

What changes were proposed in this pull request?

VolumeUsage#hasVolumeEnoughSpace should treat volumeFreeSpaceToSpare as reserved space.
Currently it's allowed to allocate space from volumeFreeSpaceToSpare.

public static boolean hasVolumeEnoughSpace(long volumeAvailableSpace,
                                           long volumeCommittedBytesCount,
                                           long requiredSpace,
                                           long volumeFreeSpaceToSpare) {
  return (volumeAvailableSpace - volumeCommittedBytesCount) >
      Math.max(requiredSpace, volumeFreeSpaceToSpare);
}

What is the link to the Apache JIRA

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

How was this patch tested?

CI:
https://github.com/peterxcli/ozone/actions/runs/13868674388
https://github.com/peterxcli/ozone/actions/runs/13869299568

@peterxcli peterxcli marked this pull request as draft March 15, 2025 03:16
@peterxcli peterxcli marked this pull request as ready for review March 15, 2025 04:04
@adoroszlai adoroszlai requested a review from ChenSammi March 15, 2025 06:25
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.

1 participant