]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Adds lock for create from vol/snap to avoid race conditions
authorEdward Hope-Morley <edward.hope-morley@canonical.com>
Thu, 14 Nov 2013 19:00:00 +0000 (19:00 +0000)
committerEdward Hope-Morley <edward.hope-morley@canonical.com>
Thu, 5 Dec 2013 10:08:46 +0000 (10:08 +0000)
commit4f6e5fcc252799e2b9207b6ef2b58b52a7a93563
tree5d4f6a107d6cf72308ffb1e1bb03c27bd23064ba
parente99cd785d8ddbffcd1d741cf336b2e929c6cb28f
Adds lock for create from vol/snap to avoid race conditions

This patch protects create from volume/snapshot by using a
lockfile to protect the operation from concurrent deletes of
the volume/snapshot used in the create operation.

Currently, if a volume/snapshot is deleted while a volume is
being created from it that delete may complete during the
create operation thus leaving the new volume in error or stuck
state. This lock will ensure that:

(a) if a create of VolA from snap/volB is in progress, any
    delete requests for snap/volB will wait until the create
    is complete.

(b) if a delete of snap/volA is in progress, any create from
    snap/volA will wait until snap/volA delete is complete.

Co-authored-by: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Closes-Bug: 1251334
Change-Id: Ie4bc0af789ab232593f55aa2f6b34345eb9b9929
cinder/tests/test_volume.py
cinder/volume/manager.py