Skip to content

quota: skip usage records registering the period a volume has been attached - #13936

Open
winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:quota-fix
Open

quota: skip usage records registering the period a volume has been attached#13936
winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:quota-fix

Conversation

@winterhazel

@winterhazel winterhazel commented Aug 20, 2026

Copy link
Copy Markdown
Member

Description

This is a follow-up of #11531 and #13909.

With #11531, the Usage server can now create up to 2 usage records for a single volume for the same period; one registers the time the volume remained allocated, while the other the time it remained attached to an instance. This results in a duplicate Quota value calculation for the volume.

For now, skip the Quota calculation for the volume usage records associating it to an instance.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  1. I enabled Quota and configured a volume tariff.
  2. I created 2 volumes.
  3. I attached only 1 of the volumes to an instance.
  4. I ran the Usage job.
  5. I verified that both the attached volume and the volume that was not attached had the same Quota consumption.

@winterhazel winterhazel added this to the 4.23.0 milestone Aug 20, 2026
@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@bernardodemarco
bernardodemarco self-requested a review August 20, 2026 14:01
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.65%. Comparing base (4bfeb96) to head (ffad096).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13936      +/-   ##
============================================
- Coverage     19.65%   19.65%   -0.01%     
+ Complexity    19803    19801       -2     
============================================
  Files          6368     6368              
  Lines        574935   574939       +4     
  Branches      70358    70359       +1     
============================================
- Hits         113026   113012      -14     
- Misses       449632   449652      +20     
+ Partials      12277    12275       -2     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 20.93% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18930

@winterhazel
winterhazel marked this pull request as ready for review August 20, 2026 15:57
@winterhazel

Copy link
Copy Markdown
Member Author

I don't think the smoke tests are going to have much value here. This change is isolated to the Quota plugin, and no Marvin test covers the Quota processing.

@JoaoJandre JoaoJandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants