Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Fixes apache#13921 Defect 1: createUsageRecord used the current snapshot ID (usageRec) for the usage label, while duration/size/diskOffering came from the previous event. This caused the first snapshot's usage to be credited to the second snapshot. Defect 2: unprocessedUsage key was vmId + volId only, so concurrent snapshots of the same volume overwrote each other. Added vmSnapshotId to the key to distinguish them. Signed-off-by: waterWang <[email protected]>
|
thanks for the fix @waterWang, can you please change the branch 4.22 ? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13924 +/- ##
============================================
- Coverage 19.65% 19.65% -0.01%
+ Complexity 19801 19796 -5
============================================
Files 6368 6368
Lines 574913 574913
Branches 70352 70352
============================================
- Hits 113024 112999 -25
- Misses 449616 449643 +27
+ Partials 12273 12271 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I've added another PR targeting 4.22 branch #14308 |
ok, closing this one |
Fixes #13921
Two defects corrected in
VMSnapshotUsageParser:Wrong snapshot ID label in usage record:
createUsageRecord()used the current snapshot's ID (usageRec.getVmSnapshotId()) while duration, size, and disk offering came from the previous event. Changed topreviousEvent.getVmSnapshotId().Concurrent snapshot key collision: The
unprocessedUsagemap keyed entries byvmId + ":" + volIdonly, so concurrent snapshots of the same volume overwrote each other. AddedvmSnapshotIdto the key to distinguish them.Root cause
From the issue body: