Skip the snapshots with Group type in snapshots resource count#12945
Skip the snapshots with Group type in snapshots resource count#12945sureshanaparti wants to merge 1 commit intoapache:4.22from
Conversation
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12945 +/- ##
=========================================
Coverage 17.60% 17.60%
- Complexity 15674 15676 +2
=========================================
Files 5917 5918 +1
Lines 531599 531670 +71
Branches 64993 65001 +8
=========================================
+ Hits 93601 93624 +23
- Misses 427442 427487 +45
- Partials 10556 10559 +3
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:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17327 |
There was a problem hiding this comment.
Pull request overview
Updates snapshot resource counting to exclude snapshots of type GROUP (which are created as part of VM instance snapshots), so account snapshot resource counts better reflect “volume snapshots” and avoid inflated counts during resource count recalculation (issue #12929).
Changes:
- Add a snapshot type exclusion filter (
snapshot_type != GROUP) to the “count snapshots by account” DAO search. - Apply the new filter in
countSnapshotsForAccount, used by resource count recalculation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public Long countSnapshotsForAccount(long accountId) { | ||
| SearchCriteria<Long> sc = CountSnapshotsByAccount.create(); | ||
| sc.setParameters("account", accountId); | ||
| sc.setParameters("status", State.Error, State.Destroyed); | ||
| sc.setParameters("snapshotTypeNEQ", Snapshot.Type.GROUP.ordinal()); | ||
| return customSearch(sc, null).get(0); |
There was a problem hiding this comment.
Consider adding/adjusting a DAO test to cover the new counting semantics here (excluding Snapshot.Type.GROUP from countSnapshotsForAccount). This method is used during resource count recalculation, so a regression test that GROUP snapshots are not counted (while non-GROUP snapshots are) would help prevent future discrepancies.
Description
This PR skips the snapshots with Group type in snapshots resource count. The snapshots with Group type are part of instance snapshot.
Fixes #12929
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?