deb-cinder/cinder/objects
Gorka Eguileor d060e8ae13 Add ordering possibilities to conditional update
Some DBs' update method are order dependent, and they behave differently
depending on the order of the values, example on a volume with
'available' status:

   UPDATE volumes SET previous_status=status, status='retyping'
   WHERE id='44f284f9-877d-4fce-9eb4-67a052410054';

Will result in a volume with 'retyping' status and 'available'
previous_status both on SQLite and MariaDB, but

   UPDATE volumes SET status='retyping', previous_status=status
       WHERE id='44f284f9-877d-4fce-9eb4-67a052410054';

Will yield the same result in SQLite but will result in a volume with
status and previous_status set to 'retyping' in MariaDB, which is not
what we want, so order must be taken into consideration.

This patch will allow conditional update to auto order the update
including the possibility of accepting a spefic ordering that takes
precedence over the automatic ordering.

Automatic order is as follow:

 1- Order specified in argument order
 2- Values that refer to other ORM field (simple and using operations,
    like size + 10)
 3- Values that use Case clause (since they may be using fields as well)
 4- All other values

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

Depends-On: I7de421252330fa27b0ad3cadbc4395a8f28a9dad
Implements: blueprint cinder-volume-active-active-support
Change-Id: Ic3a42a5bd2c7436328dc3bf449d463e170d9f807
2016-05-05 11:27:50 +02:00
..
__init__.py Add backref relationships to ConsistencyGroup obj 2015-12-29 16:09:40 +01:00
backup.py Make nullable of fields in db model and object match 2016-02-29 06:29:54 +00:00
base.py Add ordering possibilities to conditional update 2016-05-05 11:27:50 +02:00
cgsnapshot.py Move get_by_id to CinderObject 2015-11-20 14:34:21 +01:00
consistencygroup.py fix ConsistencyGroup volume_type_id field 2016-04-11 09:52:32 +00:00
fields.py Replication v2.1 (Cheesecake) 2016-02-26 13:15:19 -07:00
service.py Merge "Make nullable of fields in db model and object match" 2016-03-07 12:26:47 +00:00
snapshot.py Add volume_type to volume object expected_attrs 2016-03-10 14:11:02 +01:00
volume_attachment.py Cleanup unused conf variables 2016-02-16 11:26:06 +11:00
volume_type.py Add volume_type to volume object expected_attrs 2016-03-10 14:11:02 +01:00
volume.py Fix volume retype failure with on-demand policy 2016-04-04 11:46:57 -04:00