Commit c6e516c
Any mutation should be conditional! (#9668)
Any INSERT or UPDATE done by the sled reservation CTE should be
conditional on the computed `INSERT_VALID` result. Otherwise inserting
the `sled_resources_vmm` record (aka successfully allocating a VMM)
could fail but the local storage allocation would be successful anyway.
This came up when testing starting _many_ instances, all with local
storage disks, in parallel: set the number of instances too high, and
even if all the local storage allocations would fit, there aren't enough
CPUs to satisfy all instance resource requests. Deleting all the
instances and disks showed that there were some "orphaned" local storage
allocations, which were not cleaned up and could never be. This case was
turned into the `local_storage_allocation_fail_due_to_vmm_resources`
test.
---------
Co-authored-by: Sean Klein <seanmarionklein@gmail.com>1 parent c12feb7 commit c6e516c
3 files changed
Lines changed: 593 additions & 214 deletions
File tree
- nexus/db-queries
- src/db
- datastore
- queries
- tests/output
0 commit comments