RemoteFSSnapDriver create_cloned_volume lock is wrong

Bug #1852449 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

See similar bug 1851512 which fixes this for RemoteFSSnapDistributedDriver (which affects the NFS driver).

For non-distributed remotefs drivers, a fix is needed in the locking for create_cloned_volume. This method currently locks against volume.id, but needs to lock against src_vref.id. This likely means that concurrent clone volume calls will fail in a messy way.

This currently only impacts the VZStorage driver.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (master)

Reviewed: https://review.opendev.org/693186
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7cc2e402f95371fa8d94295016127eb3b716508f
Submitter: Zuul
Branch: master

commit 7cc2e402f95371fa8d94295016127eb3b716508f
Author: Eric Harney <email address hidden>
Date: Wed Nov 6 09:22:27 2019 -0500

    Fix remotefs clone volume locking

    Any method in the remotefs/nfs code that manipulates
    the qcow2 snapshot chain must be run separately
    from other methods that may touch this snapshot chain.

    This code intended to do this with a lock on the
    volume id, but it unintentionally locked only on
    the destination volume id rather than the source
    volume id where the snapshots are.

    This causes concurrent clone operations to fail in
    the NFS driver. This patch fixes this in the
    RemoteFSSnapDriverDistributed class which fixes the
    NFS driver and a handful of others.

    A follow up patch should be applied for the
    RemoteFSSnapDriver class with a similar change, but as
    that class is only used by one driver (which I can't
    test), this patch only adds a TODO for that change.

    Related-Bug: #1840712
    Related-Bug: #1852449
    Closes-Bug: #1851512

    Change-Id: I64e041feaeb50c95808da46a34f334a9985018a8

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/694653

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (stable/train)

Reviewed: https://review.opendev.org/694653
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=408155b8905ad23035ce06ec5aee8532ab9642e9
Submitter: Zuul
Branch: stable/train

commit 408155b8905ad23035ce06ec5aee8532ab9642e9
Author: Eric Harney <email address hidden>
Date: Wed Nov 6 09:22:27 2019 -0500

    Fix remotefs clone volume locking

    Any method in the remotefs/nfs code that manipulates
    the qcow2 snapshot chain must be run separately
    from other methods that may touch this snapshot chain.

    This code intended to do this with a lock on the
    volume id, but it unintentionally locked only on
    the destination volume id rather than the source
    volume id where the snapshots are.

    This causes concurrent clone operations to fail in
    the NFS driver. This patch fixes this in the
    RemoteFSSnapDriverDistributed class which fixes the
    NFS driver and a handful of others.

    A follow up patch should be applied for the
    RemoteFSSnapDriver class with a similar change, but as
    that class is only used by one driver (which I can't
    test), this patch only adds a TODO for that change.

    Related-Bug: #1840712
    Related-Bug: #1852449
    Closes-Bug: #1851512

    Change-Id: I64e041feaeb50c95808da46a34f334a9985018a8
    (cherry picked from commit 7cc2e402f95371fa8d94295016127eb3b716508f)

tags: added: in-stable-train
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.