Comment 2 for bug 1026709

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10026
Committed: http://github.com/openstack/nova/commit/b244f6fde2e4b85a01a8e0a340d12a1fa9073236
Submitter: Jenkins
Branch: master

commit b244f6fde2e4b85a01a8e0a340d12a1fa9073236
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
    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.

    Change-Id: Ia364496a996870d754094915ea0501ff19052037