deb-murano/murano
Alexander Tivelkov f2ba54b62b 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
2015-04-13 13:54:54 +00:00
..
api Merge "Forbid setting is_public via querystring" 2015-04-10 10:35:09 +00:00
cmd Use oslo.i18n for translation 2015-02-19 18:51:22 +03:00
common Nova Network support 2015-04-08 13:09:21 +03:00
db A Galera-compliant database locking solution 2015-04-13 13:54:54 +00:00
dsl Safely encode yaql expressions to support unicode expressions 2015-03-31 09:34:01 +00:00
engine Nova Network support 2015-04-08 13:09:21 +03:00
locale Rename muranoapi to murano 2014-05-27 15:14:44 +04:00
openstack Use oslo.i18n for translation 2015-02-19 18:51:22 +03:00
packages Fix error with package tags type 2015-03-13 11:43:40 +03:00
policy Policy enforcement 'services' relationship 2015-04-07 13:28:13 +02:00
services Fixed 500 error in get_result API handler 2015-03-26 15:59:19 +00:00
tests Merge "Forbid setting is_public via querystring" 2015-04-10 10:35:09 +00:00
__init__.py Extract version definition to a separate file 2014-11-10 13:02:56 +04:00
context.py Update API policy 2015-03-02 15:28:14 +03:00
opts.py fix typo 2015-03-09 16:12:11 +09:00
utils.py Functional tests for environment template functionality 2015-03-18 09:08:18 +01:00
version.py Extract version definition to a separate file 2014-11-10 13:02:56 +04:00