mirror of
https://opendev.org/openstack/ironic.git
synced 2026-01-16 23:01:47 +00:00
Merge "DB: Select upon delete for allocations" into stable/2023.1
This commit is contained in:
commit
c39f539859
1 changed files with 5 additions and 1 deletions
|
|
@ -2272,7 +2272,11 @@ class Connection(api.Connection):
|
|||
query = add_identity_filter(query, allocation_id)
|
||||
|
||||
try:
|
||||
ref = query.one()
|
||||
# NOTE(TheJulia): We explicitly need to indicate we intend
|
||||
# to update the record so we block until the other users of
|
||||
# the row are free, such as the process to match the
|
||||
# allocation to a node.
|
||||
ref = query.with_for_update().one()
|
||||
except NoResultFound:
|
||||
raise exception.AllocationNotFound(allocation=allocation_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue