Comment 3 for bug 1440094

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

Reviewed: https://review.openstack.org/172905
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=f2ba54b62ba52d9079cb986f6efc8fd22f55b29b
Submitter: Jenkins
Branch: master

commit f2ba54b62ba52d9079cb986f6efc8fd22f55b29b
Author: Alexander Tivelkov <email address hidden>
Date: Mon Apr 13 15:52:38 2015 +0300

    A Galera-compliant database locking solution

    A common scenario in database interaction is to check some values in
    database and update them if some condition is met (or is not met). To
    prevent race conditions in such scenarios it is recomended to isolate
    appropriate transactions at read level, so two "select" operations are
    not executed in parallel. This may be achieved either by modifying
    transaction_isolation_level or by doing "selects" with a "for update"
    keyword, which puts a lock on the entries being selected thus blocking
    any other selects which may run in parallel transaction.

    The problem is that SELECT FOR UPDATE is not fully supported in Galera
    clusters which are a common tool for building HA openstack environments.
    Such statements may have non-determenistic results - see [1] for more
    details.

    This patch intoruduces a simple exclusive lock mechanics: it executes a
    simple insert or update operation into a special table. Any other
    transactions attempting to do the same will block until the first one
    completes in one way or another. This results in a simple but reliable
    locking solution, which may be not as effecient as dedicated distributed
    lock systems but still do its job nicely.

    Partial-bug: #1440094
    Change-Id: Ib606f33b832b04a3ecac27e1e10018ea8fd503a5