Change in vdsm[ovirt-3.5]: hsm: lock pool when running upgradeStoragePool

laravot at redhat.com laravot at redhat.com
Thu Sep 10 07:38:09 UTC 2015


Liron Aravot has uploaded a new change for review.

Change subject: hsm: lock pool when running upgradeStoragePool
......................................................................

hsm: lock pool when running upgradeStoragePool

When running upgradeStoragePool we use the pool metadata to know which
domains needs upgrade, having no pool lock means that races with flows
that manipulate the pool metadata like activateSd and deactivateSd might
occur.

Change-Id: I1d5b65a75b1b50d5f5991334cf6221c067a31f5b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1260429
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/45977/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 57063f1..da571fc 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3550,7 +3550,11 @@
     def upgradeStoragePool(self, spUUID, targetDomVersion):
         targetDomVersion = int(targetDomVersion)
         pool = self.getPool(spUUID)
-        pool._upgradePool(targetDomVersion)
+        # This lock has to be mutual with the pool metadata operations (like
+        # activateSD/deactivateSD) as it uses the pool metadata.
+        with rmanager.acquireResource(STORAGE, spUUID,
+                                      rm.LockType.exclusive):
+            pool._upgradePool(targetDomVersion)
         return {"upgradeStatus": "started"}
 
     def _getDomsStats(self, domainMonitor, doms):


-- 
To view, visit https://gerrit.ovirt.org/45977
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d5b65a75b1b50d5f5991334cf6221c067a31f5b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Liron Aravot <laravot at redhat.com>


More information about the vdsm-patches mailing list