summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-05-06 05:00:30 +0000
committerGerrit Code Review <review@openstack.org>2021-05-06 05:00:30 +0000
commitdd1f6b014919b9af50d8202bda736a4e4bed4af8 (patch)
tree4559df2affa2b8f45d93633aadc82aa602a264a8
parent9739025740e96fa824f24b2ca84c1131e5fd634e (diff)
parent3bb28c637e98078a4da2b6930e56bfce0cce9f73 (diff)
downloadcinder-dd1f6b014919b9af50d8202bda736a4e4bed4af8.tar.gz
Merge "Backup manager: Synchronously call remove_export" into stable/train
-rw-r--r--cinder/backup/manager.py2
-rw-r--r--cinder/volume/rpcapi.py7
-rw-r--r--releasenotes/notes/bug-1920237-backup-remove-export-race-941e2ab1f056e54c.yaml8
3 files changed, 14 insertions, 3 deletions
diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py
index 6c6c44799..68fa76315 100644
--- a/cinder/backup/manager.py
+++ b/cinder/backup/manager.py
@@ -1074,7 +1074,7 @@ class BackupManager(manager.ThreadPoolManager):
if not is_snapshot:
rpcapi.terminate_connection(ctxt, device, properties,
force=force)
- rpcapi.remove_export(ctxt, device)
+ rpcapi.remove_export(ctxt, device, sync=True)
else:
rpcapi.terminate_connection_snapshot(ctxt, device,
properties, force=force)
diff --git a/cinder/volume/rpcapi.py b/cinder/volume/rpcapi.py
index e43a0d447..9b72583bc 100644
--- a/cinder/volume/rpcapi.py
+++ b/cinder/volume/rpcapi.py
@@ -231,9 +231,12 @@ class VolumeAPI(rpc.RPCAPI):
return cctxt.call(ctxt, 'terminate_connection', volume_id=volume['id'],
connector=connector, force=force)
- def remove_export(self, ctxt, volume):
+ def remove_export(self, ctxt, volume, sync=False):
cctxt = self._get_cctxt(volume.service_topic_queue)
- cctxt.cast(ctxt, 'remove_export', volume_id=volume['id'])
+ if sync:
+ cctxt.call(ctxt, 'remove_export', volume_id=volume.id)
+ else:
+ cctxt.cast(ctxt, 'remove_export', volume_id=volume.id)
def publish_service_capabilities(self, ctxt):
cctxt = self._get_cctxt(fanout=True)
diff --git a/releasenotes/notes/bug-1920237-backup-remove-export-race-941e2ab1f056e54c.yaml b/releasenotes/notes/bug-1920237-backup-remove-export-race-941e2ab1f056e54c.yaml
new file mode 100644
index 000000000..91cd552af
--- /dev/null
+++ b/releasenotes/notes/bug-1920237-backup-remove-export-race-941e2ab1f056e54c.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ `Bug #1920237 <https://bugs.launchpad.net/cinder/+bug/1920237>`_: The
+ backup manager calls volume remove_export() but does not wait for it to
+ complete when detaching a volume after backup. This caused problems
+ when a subsequent operation started on that volume before it had fully
+ detached.