The code in quota_reserve acquires SQL locks in a different order than
the code in reservation_commit/reservation_rollback. This can result in
an SQL deadlock under heavy load. Due to an (unrelated) bug in
SQLAlchemy, this can result in this exception:
ResourceClosedError: This result object does not return rows. It has
been closed automatically.
This patch reorganizes the code to always fetch (and thusly lock) the
quota_usages table before the reservations table.
Reviewed: https:/ /review. openstack. org/10026 github. com/openstack/ nova/commit/ b244f6fde2e4b85 a01a8e0a340d12a 1fa9073236
Committed: http://
Submitter: Jenkins
Branch: master
commit b244f6fde2e4b85 a01a8e0a340d12a 1fa9073236
Author: Johannes Erdfelt <email address hidden>
Date: Thu Jul 19 17:11:24 2012 +0000
Fix SQL deadlock in quota reservations
Fixes bug 1026709
The code in quota_reserve acquires SQL locks in a different order than commit/ reservation_ rollback. This can result in
the code in reservation_
an SQL deadlock under heavy load. Due to an (unrelated) bug in
SQLAlchemy, this can result in this exception:
ResourceClo sedError: This result object does not return rows. It has
been closed automatically.
This patch reorganizes the code to always fetch (and thusly lock) the
quota_usages table before the reservations table.
Change-Id: Ia364496a996870 d754094915ea050 1ff19052037