cinder/cinder/tests/unit
Eric Harney eadff0df7e 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)
Depends-On: https://review.opendev.org/671370
2019-07-31 11:38:37 -04:00
..
api Prevent double-attachment race in attachment_reserve 2019-07-31 11:38:37 -04:00
attachments Prevent double-attachment race in attachment_reserve 2019-07-31 11:38:37 -04:00
backup Fix swift backup driver crashing during service startup 2019-04-30 11:59:14 -04:00
brick Revert "Synchronize all LVM operations" 2018-12-18 00:18:41 +00:00
cmd Add Upgrade Check for Drivers Removed in Stein 2019-05-31 13:38:12 -05:00
compute Add user messages for extend volume operation 2018-06-01 09:12:07 +08:00
consistencygroup Remove unused CG code 2017-03-19 00:49:10 -04:00
db Extend timeout for database migration tests 2019-02-25 10:37:55 -05:00
glance
group Fix gigabytes usage error when deleting snapshot group 2019-01-21 11:42:00 +01:00
image Pass image_id to ImageDownloadFailed 2019-01-17 21:41:46 +00:00
keymgr Add 'volume_attachment' to volume expected attributes 2018-08-21 17:06:12 +08:00
message Use constants for microversion values 2017-09-22 08:15:56 -05:00
monkey_patch_example
objects Merge "Fix VolumeAttachment is not bound to a Session" 2019-03-20 18:30:41 +00:00
policies Refactor on policy in code 2019-01-15 01:22:37 +00:00
scheduler Fix the problem of the scheduler status 2018-11-30 17:39:14 +09:00
targets Switch ietadm to use olso.privsep 2019-01-11 13:30:55 +00:00
volume Fix assertion methods in a unit test 2019-06-21 00:15:57 +00:00
windows Merge "SMBFS: allow snapshot ro attach" 2018-02-21 19:37:34 +00:00
zonemanager Merge "Fix for auth version change in Brcd HTTP" 2019-02-23 10:07:03 +00:00
__init__.py
cast_as_call.py
conf_fixture.py Stop using deprecated rpc_backend option 2018-10-08 20:52:53 +00:00
fake_cluster.py
fake_constants.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_group.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_group_snapshot.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_notifier.py Short-circuit notifications when not enabled 2017-01-30 12:31:45 +01:00
fake_objects.py
fake_service.py Fix migration 112 to use live_data_migration API 2017-10-20 18:24:33 -06:00
fake_snapshot.py Add volume to fake snapshot object 2017-01-17 16:55:44 +05:30
fake_utils.py
fake_volume.py Fix VolumeAttachment is not bound to a Session 2019-03-15 11:29:25 +01:00
policy.json Add policy test for volume extend/retype/update_ro policy 2019-01-15 01:22:24 +00:00
test_api.py
test_api_urlmap.py
test_cleanable_manager.py
test_cmd.py Enable some tests in the cinder.tests.unit.test_cmd module for MacOS 2019-01-11 13:26:45 +00:00
test_context.py Update oslo.context RequestContext args 2017-11-21 14:56:06 -06:00
test_coordination.py Handle deprecation of inspect.getargspec 2017-11-21 12:57:05 -06:00
test_db_api.py Fix wrong filter of backups in db api 2018-09-11 22:17:39 +08:00
test_db_worker_api.py Prevent claiming and updating races on worker 2017-01-19 10:42:24 +01:00
test_evaluator.py
test_exception.py Make CinderException format errors fatal for tests 2018-02-06 21:17:17 +00:00
test_fixtures.py Explicitly set expected log level for tests 2017-11-17 16:58:40 -06:00
test_hacking.py Update log translation hacking rule 2017-06-29 04:05:52 -04:00
test_image_utils.py Add missing ws seperator between words 2019-01-23 14:21:15 +08:00
test_manager.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
test_paginate_query.py Don't use None value for sql query. 2017-02-04 09:31:27 +08:00
test_policy.py Add policy granularity to the encryption API 2018-08-15 09:22:25 -05:00
test_qos_specs.py Add enough notification for QoS 2018-01-18 14:04:29 +08:00
test_quota.py Remove auth_uri usage 2018-08-29 11:46:11 +08:00
test_quota_utils.py Remove auth_uri usage 2018-08-29 11:46:11 +08:00
test_rpc.py Fix notification short-circuit 2017-02-01 17:11:14 +01:00
test_service.py Use InvalidConfigurationValue instead of InvalidInput 2018-04-11 19:25:48 +08:00
test_service_auth.py Add service_token for cinder-nova interaction 2017-12-15 12:04:23 +05:30
test_setup_profiler.py Use constants for cinder-volume 2017-12-29 09:05:08 +08:00
test_ssh_utils.py Stop a connections leak when freeing an SSHPool 2018-02-14 18:16:55 -06:00
test_test.py Fix test_rpc_consumer_isolation for oslo.messaging 5.31.0 2017-09-06 15:12:45 -04:00
test_test_utils.py Update oslo.context RequestContext args 2017-11-21 14:56:06 -06:00
test_utils.py Mask passwords in utils.trace for func params 2019-01-02 17:22:07 +08:00
test_volume_cleanup.py Clean up image tmp file if c-vol gets restarted 2017-01-17 17:28:39 +08:00
test_volume_configuration.py Add support for shared "backend_defaults" config 2017-07-11 18:58:58 +00:00
test_volume_glance_metadata.py
test_volume_throttling.py Implement privsep boilerplate in cinder. 2018-06-06 09:42:54 +08:00
test_volume_transfer.py Improve volume transfer records 2019-01-14 11:50:43 +08:00
test_volume_types.py Delete related encryption provider when a volume type is deleting 2018-12-27 08:14:52 -05:00
test_volume_types_extra_specs.py
test_volume_utils.py Add check_encryption_provider to volume utils 2019-01-22 14:42:56 -05:00
utils.py Extend timeout for database migration tests 2019-02-25 10:37:55 -05:00