Browse Source

Merge "Fix remotefs clone volume locking"

changes/60/694460/1
Zuul 3 weeks ago
parent
commit
5ad452fcd4
2 changed files with 15 additions and 0 deletions
  1. +3
    -0
      cinder/volume/drivers/remotefs.py
  2. +12
    -0
      releasenotes/notes/fix-remotefs-clone-volume-locking-385e740d4a5a813b.yaml

+ 3
- 0
cinder/volume/drivers/remotefs.py View File

@@ -1654,6 +1654,7 @@ class RemoteFSSnapDriver(RemoteFSSnapDriverBase):
def create_volume_from_snapshot(self, volume, snapshot):
return self._create_volume_from_snapshot(volume, snapshot)

# TODO: should be locking on src_vref id -- bug #1852449
@locked_volume_id_operation
def create_cloned_volume(self, volume, src_vref):
"""Creates a clone of the specified volume."""
@@ -1696,6 +1697,8 @@ class RemoteFSSnapDriverDistributed(RemoteFSSnapDriverBase):
def create_volume_from_snapshot(self, volume, snapshot):
return self._create_volume_from_snapshot(volume, snapshot)

# lock the source volume id first
@coordination.synchronized('{self.driver_prefix}-{src_vref.id}')
@coordination.synchronized('{self.driver_prefix}-{volume.id}')
def create_cloned_volume(self, volume, src_vref):
"""Creates a clone of the specified volume."""

+ 12
- 0
releasenotes/notes/fix-remotefs-clone-volume-locking-385e740d4a5a813b.yaml View File

@@ -0,0 +1,12 @@
---
fixes:
- |
An incorrect lock in the remotefs code, which is used for the NFS driver,
and other similar drivers, resulted in concurrent clone volume operations
failing. create_cloned_volume now locks on the source volume id, meaning
multiple clone operations from the same source volume are serialized.

A lock in the volume manager flow generally prevents this on normal clone
volume operations, but this clone method in the driver is called for
operations such as cloning from the cinder image-volume cache or cloning
from a cinder backend used as a glance store.

Loading…
Cancel
Save