Remove API races from consistency groups

There is a potential window of opportunity where races can happen in the
API on consistency group related actions, this patch removes those
windows of opportunity using compare-and-swap for DB updates.

Races have been removed in following actions:

- create
- delete
- update
- create_cgsnapshot
- delete_cgsnapshot

Specs: https://review.openstack.org/232599/

Implements: blueprint cinder-volume-active-active-support
Change-Id: I67aec4cd8bcf2f7e09473a8d296aa383fe85ad23
This commit is contained in:
Gorka Eguileor
2015-12-18 10:15:14 +01:00
parent 1bc8850f4d
commit 253f9ea67b
12 changed files with 681 additions and 237 deletions

View File

@@ -52,7 +52,13 @@ ignore_messages = [
# Note(aarefiev): this error message is for SQLAlchemy rename calls in
# DB migration(033_add_encryption_unique_key).
"Instance of 'Table' has no 'rename' member"
"Instance of 'Table' has no 'rename' member",
# NOTE(geguileo): these error messages are for code [E1101], and they can
# be ignored because a SQLAlchemy ORM class will have __table__ member
# during runtime.
"Class 'ConsistencyGroup' has no '__table__' member",
"Class 'Cgsnapshot' has no '__table__' member",
]
# Note(maoy): We ignore cinder.tests for now due to high false