-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix inconsistencies that result in Usage generating usage records when it should not #9888
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #9888 +/- ##
============================================
+ Coverage 15.78% 15.81% +0.02%
- Complexity 12565 12581 +16
============================================
Files 5627 5627
Lines 492260 492267 +7
Branches 63882 63886 +4
============================================
+ Hits 77710 77832 +122
+ Misses 406076 405912 -164
- Partials 8474 8523 +49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@blueorangutan package |
engine/schema/src/main/java/com/cloud/usage/dao/UsageNetworksDaoImpl.java
Show resolved
Hide resolved
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 11602 |
@blueorangutan package |
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.
CLGTM, I did not manually test it.
@BryanMLima 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11660 |
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.
Code lgtm
@blueorangutan package |
@Pearl1594 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 12463 |
@blueorangutan test |
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
@blueorangutan test |
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-12463)
|
Description
This PR fixes some inconsistencies which results in Usage generating usage records when it should not, namely:
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
Duplicated usage record generation for networks
Allocated
Before the changes, after the Usage job finishes, there would be two non-removed helper entries for the same network, resulting in duplicated usage records being generated for the network. After the changes, the first helper entry was marked as removed.
Removed port forwarding rules generating usage records
cloud_usage.usage_port_forwarding
, that the helper entry had an ID different from the PF rule's IDBefore the changes, the helper entry would not get marked as removed in step 5, resulting in usage records still being generated for the removed PF rule. After the changes, the helper entry got marked as removed.
Removed load balancer policies generating usage records
cloud_usage.usage_load_balancer_policy
, that the helper entry had an ID different from the LB policy's IDBefore the changes, the helper entry would not get marked as removed in step 5, resulting in usage records still being generated for the removed LB policy. After the changes, the helper entry got marked as removed.
Removed VM snapshots generating usage records
cloud_usage.usage_snapshot_on_primary
, that the helper entry had IDs different from the VM's IDBefore the changes, the helper entries would not get marked as removed in step 5, resulting in usage records still being generated for the removed VM snapshots. After the changes, the helper entries got marked as removed.
Volumes in the secondary storage that were attached still generate usage records
cloud_usage.usage_storage
, that the helper entry had had an ID different from the volume's IDBefore the changes, a helper entry would be created to generate secondary storage usage records for the volume (in
cloud_usage.usage_storage
). After attaching, another entry would be created to generate primary storage volume usage records; however, the secondary storage helper entry did not get removed, resulting in secondary storage usage records being generated for a volume that was not in the secondary storage anymore.After the changes, the secondary storage helper entry was marked as removed.