volume create race condition protection

Bug #1251334 reported by Edward Hope-Morley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Edward Hope-Morley

Bug Description

Creating a volume from another volume or snapshot is currently prone to being interrupted by a concurrent delete of the dependant volume or snapshot. Concern over this was also raised within the new taskflow implementation:

https://github.com/openstack/cinder/blob/master/cinder/volume/flows/create_volume/__init__.py#L463

Changed in cinder:
status: New → In Progress
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Applying this patch and then doing a create from snapshot and delete snapshot concurrenlty will trigger the expected exception.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/56442

Changed in cinder:
importance: Undecided → Medium
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-1 → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/56442
Committed: http://github.com/openstack/cinder/commit/4f6e5fcc252799e2b9207b6ef2b58b52a7a93563
Submitter: Jenkins
Branch: master

commit 4f6e5fcc252799e2b9207b6ef2b58b52a7a93563
Author: Edward Hope-Morley <email address hidden>
Date: Thu Nov 14 19:00:00 2013 +0000

    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 <email address hidden>
    Closes-Bug: 1251334
    Change-Id: Ie4bc0af789ab232593f55aa2f6b34345eb9b9929

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.