Merge "DB: Select upon delete for allocations"
This commit is contained in:
commit
ee77f0b40d
@ -2392,7 +2392,11 @@ class Connection(api.Connection):
|
|||||||
query = add_identity_filter(query, allocation_id)
|
query = add_identity_filter(query, allocation_id)
|
||||||
|
|
||||||
try:
|
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:
|
except NoResultFound:
|
||||||
raise exception.AllocationNotFound(allocation=allocation_id)
|
raise exception.AllocationNotFound(allocation=allocation_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user