-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix Volume Size Rounding Issue in PowerFlex #357
Conversation
@@ -105,6 +105,22 @@ func TestGetVolSize(t *testing.T) { | |||
}, | |||
sizeKiB: 0, | |||
}, | |||
{ | |||
// Requesting a size with decimal part that rounds up to next multiple of 8 GiB | |||
cr: &csi.CapacityRange{ |
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.
Could we add more test cases with higher decimal precision values? Additionally, let's use the same input that helped us identify this issue for consistency.
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.
Done
Please perform end-to-end integration testing to ensure nothing is impacted. Are there any additional scenarios we can consider here, especially related to expanding volume size? I assume a similar check will be reused for those cases as well, correct? |
// if the requested size was less than 1GB, set the request to 1GB | ||
// so it can be rounded to a 8GiB boundary correctly | ||
if sizeGiB == 0 { | ||
if sizeGiB < 1 { |
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.
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.
I have tested NFS with filesystem sizes of 48.8 GiB and 3.001 GiB (3073 MiB). In both cases, the filesystems were successfully created. The only requirement for filesystem creation is that the size must not be less than 3 GiB, which is handled in the code.
6a34c35
I have executed the integration test. The ControllerExpandVolume call also invokes the validateVolSize function to perform similar checks on the expanding volume size. |
Description
When creating a volume in PowerFlex, it appears to round down instead of up for sizes that are multiples of 8GB, fixing this issue.
GitHub Issues
List the GitHub issues impacted by this PR:
Checklist:
How Has This Been Tested?
pflex-cert-csi.txt
pflex-integration.txt