Repository navigation
Conversation
Pearl1594
requested review from
DaanHoogland,
vladimirpetrov and
weizhouapache
October 7, 2026 13:07
Pearl1594
marked this pull request as ready for review
October 7, 2026 13:10
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14341 +/- ##
============================================
- Coverage 18.02% 18.02% -0.01%
+ Complexity 16250 16248 -2
============================================
Files 5936 5936
Lines 535823 535821 -2
Branches 65612 65612
============================================
- Hits 96582 96560 -22
- Misses 428242 428264 +22
+ Partials 10999 10997 -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:
|
Contributor
Author
|
@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19444 |
2 of 9 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR fixes 2 issues:
Removing a nic can silently close a different nic's still-open usage record : UsageNetworkOfferingDaoImpl.update()'s UPDATE_DELETED SQL matched on (account_id, vm_instance_id, network_offering_id) only - not nic_id. On a VM with two nics on two different networks that happen to share one network offering, removing one nic would also close the other nic's still-active usage row, silently under-billing it from that point on. Fixed by matching on the row's own primary key (id).
updateDefaultNicForVirtualMachine can wipe billing for the nic becoming default : The default-nic swap emits 4 usage events: REMOVE(old-default), ASSIGN(new-default), REMOVE(new-default's stale row), ASSIGN(old-default's new row), in that order. Because a default-nic swap never changes which network a nic is on, the 3rd call's REMOVE always collides with the row the 2nd call's ASSIGN just created (identical nic/offering/network, nothing to disambiguate by). The lookup can't tell the stale row from the brand-new one and closes both, leaving the nic becoming default with zero open billing until the VM's next full stop/start. Fixed by reordering to close-before-open per nic (REMOVE old, REMOVE new's stale row, ASSIGN new, ASSIGN old)
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?