cinder/cinder/tests/unit/api/v3
Eric Harney 5f9c93b194 Prevent double-attachment race in attachment_reserve
If multiple attachments are requested simultaneously,
a volume can be attached to an instance more than once.

This fixes this problem by detecting that a race has
occurred in _attachment_reserve, and backing out one of
the invalid attachment records.

This means that if the attachment API is called
repeatedly and quickly for the same volume, some requests
may fail, but this is much better than incorrectly
creating multiple attachments.

Closes-Bug: #1833736

Change-Id: Ic2463338b698c5cf805c0ae06d0229f54f64b3fc
(cherry picked from commit 7f3a77b66f)
(cherry picked from commit eadff0df7e)
Conflicts:
	cinder/tests/unit/attachments/test_attachments_api.py
Depends-On: https://review.opendev.org/673851/
2019-08-01 13:34:44 -04:00
..
__init__.py Microversion of Bootable filter in cinder list 2016-04-21 15:17:15 +00:00
fakes.py Use newer location for iso8601 UTC 2017-09-08 07:38:35 -05:00
stubs.py Use newer location for iso8601 UTC 2017-09-08 07:38:35 -05:00
test_attachments.py Prevent double-attachment race in attachment_reserve 2019-08-01 13:34:44 -04:00
test_backups.py Remove leading and trailing spaces from parameters 2018-01-17 11:45:34 +05:30
test_cluster.py V3 jsonschema validation: os-services 2018-05-14 12:44:56 +05:30
test_consistencygroups.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_group_snapshots.py Update delete group snapshot API exception handling 2018-07-31 17:36:10 -04:00
test_group_specs.py V3 jsonschema validation: Group type specs 2017-12-12 14:48:42 +05:30
test_group_types.py Fix combination of parameters for update APIs 2018-01-18 14:19:13 +05:30
test_groups.py V3 json schema validation: generic volume groups 2018-05-08 18:07:28 +05:30
test_limits.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_messages.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_resource_filters.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_snapshot_manage.py Schedule request to scheduler when manage existing snapshot 2018-01-31 00:48:08 +00:00
test_snapshots.py V2/V3 jsonschema validation: snapshots 2018-01-02 09:22:20 +05:30
test_types.py Support availability-zone type 2018-05-17 12:09:12 +00:00
test_volume_manage.py Use constants for cinder-volume 2017-12-29 09:05:08 +08:00
test_volume_metadata.py V3 jsonschema validation: Volumes 2018-06-29 11:51:50 +05:30
test_volume_transfer.py Correct volume-transfers API endpoint 2018-08-03 17:56:14 -05:00
test_volumes.py Forbidden to revert volume to a different size snapshot 2018-10-26 18:41:35 +00:00
test_workers.py V3 json schema validation: workers 2018-04-16 09:54:36 +05:30