server: clear resource reservation and increment resource count in a transaction - #7724
Conversation
…transaction This PR addresses rare case of potential overlap of resource reservation and resource count. For different resource types there could be some delay between incrementing of the resource count and clearing of the earlier done reservation. This may result in failures when there are parallel deployments happening. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SF] 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
@@ Coverage Diff @@
## 4.18 #7724 +/- ##
==========================================
Coverage 13.01% 13.01%
- Complexity 9011 9026 +15
==========================================
Files 2716 2719 +3
Lines 256656 256877 +221
Branches 40021 40052 +31
==========================================
+ Hits 33410 33445 +35
- Misses 219060 219243 +183
- Partials 4186 4189 +3
... and 17 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6423 |
DaanHoogland
left a comment
There was a problem hiding this comment.
code looks good but can you put the transaction in a separate method and not in with the precondition checks, please.
|
@DaanHoogland refactored @blueorangutan package |
|
@shwstppr a [SF] 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. |
harikrishna-patnala
left a comment
There was a problem hiding this comment.
I hit this issue too. Thanks @shwstppr
Code LGTM
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6425 |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
@blueorangutan test |
|
@shwstppr a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7029)
|
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM , Manually tested the fix
Before fix
Logs messages
"errortext":"Maximum domain resource limits of Type 'user_vm' for Domain Id = 435 is exceeded: Domain Resource Limit = 5, Current Domain Resource Amount = 4, Current Resource Reservation = 1, Requested Resource Amount = 1."
Updated the domain limit to 5, and deployed 6 vm in parallel
2023-07-18 16:26:49,994 ERROR [c.c.r.ResourceLimitManagerImpl] (qtp737826424-1595:ctx-66f84de9 ctx-be6fe214 ctx-d8954cd3) (logid:91ec9d9f) Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = (5 bytes) 5, Current Domain Resource Amount = (6 bytes) 6, Requested Resource Amount = (1 bytes) 1.
com.cloud.exception.ResourceAllocationException: Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = (5 bytes) 5, Current Domain Resource Amount = (6 bytes) 6, Requested Resource Amount = (1 bytes) 1.
com.cloud.exception.ResourceAllocationException: Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = (5 bytes) 5, Current Domain Resource Amount = (6 bytes) 6, Requested Resource Amount = (1 bytes) 1.
After fix
Logs messages
2023-07-18 17:32:05,911 ERROR [c.c.r.ResourceLimitManagerImpl] (qtp1008561904-26:ctx-aaceba8c ctx-1561cceb ctx-b957dd77) (logid:8e101cc4) Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = 5, Current Domain Resource Amount = 0, Current Resource Reservation = 5, Requested Resource Amount = 1.
com.cloud.exception.ResourceAllocationException: Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = 5, Current Domain Resource Amount = 0, Current Resource Reservation = 5, Requested Resource Amount = 1.
com.cloud.exception.ResourceAllocationException: Maximum domain resource limits of Type 'user_vm' for Domain Id = 2 is exceeded: Domain Resource Limit = 5, Current Domain Resource Amount = 0, Current Resource Reservation = 5, Requested Resource Amount = 1.
|
@blueorangutan package |
|
@DaanHoogland a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6586 |
Description
This PR addresses rare cases of potential overlap of resource reservation and resource count. For different resource types there could be some delay between incrementing of the resource count and clearing of the earlier done reservation. This may result in failures when there are parallel deployments happening.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?