fix: Allow small size differences to match the device min size#526
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #526 +/- ##
==========================================
- Coverage 16.54% 10.67% -5.88%
==========================================
Files 2 8 +6
Lines 284 1958 +1674
Branches 79 0 -79
==========================================
+ Hits 47 209 +162
- Misses 237 1749 +1512
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We are currently allowing up to 2 % size difference from requested size when creating or resizing volumes to fit them into pool free space (see linux-system-roles#199). This applies the same logic for device minimum size limits when resizing. Resolves: RHEL-82825
108d354 to
09bcef6
Compare
| - name: Test xfs | ||
| block: | ||
| - name: Run test on supported platforms | ||
| when: ((is_fedora and blivet_pkg_version is version("3.12.1-3", ">=")) or |
There was a problem hiding this comment.
This version is not yet available, keeping the PR as draft for now.
There was a problem hiding this comment.
python-blivet-3.12.1-3 is now available in rawhide and should be available in F42 repos soon.
Related: RHEL-82825
09bcef6 to
8efa482
Compare
Reviewer's GuideThis PR updates the resize implementation to tolerate small deviations from device size limits by snapping targets within a 2% threshold to min_size as well as max_size, and adds new tests for both Ext4 and XFS scenarios to verify idempotency when resizing slightly above max and below min limits. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @vojtechtrefny - I've reviewed your changes - here's some feedback:
- The new resize logic for up‐ and down‐sizing in blivet.py is almost identical—consider extracting the common trim_percent calculation and adjustment into a helper to reduce duplication.
- The resize tests in tests/tests_resize.yml repeat the same blocks for ext4 and XFS—factor out the common steps into a reusable include or loop to DRY up the file and make it easier to maintain.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[citest] |
|
[citest_bad] |
|
@vojtechtrefny ready to merge? |
Yes, sorry, I forgot about this. The fixed version of blivet is now available in both rawhide and f42 so this can be merged. |
556dcda
into
linux-system-roles:main
Cause: We are currently allowing up to 2 % size difference from requested size when creating or resizing volumes to fit them into pool free space (see #199). This applies the same logic for device minimum size limits when resizing.
Consequence: The sizes do not match when running the role again, causing the role to think something has changed.
Fix: Ensure that a small size difference does not cause the role to think the size has changed.
Result: The role is idempotent.
Resolves: https://issues.redhat.com/browse/RHEL-82825
Summary by Sourcery
Allow minor size variations around device minimum limits when resizing volumes to prevent idempotency issues and mirror existing max size tolerance
Bug Fixes:
Enhancements:
Tests: