Change in vdsm[master]: sp.py: Assume a hostId when reconstructing master

amureini at redhat.com amureini at redhat.com
Fri Apr 8 10:38:43 UTC 2016


Allon Mureinik has uploaded a new change for review.

Change subject: sp.py: Assume a hostId when reconstructing master
......................................................................

sp.py: Assume a hostId when reconstructing master

As we no longer support V1/V2 domains, we can assume a hostId is
present.

Change-Id: Iaffbb563532a40f67f33fd971f55724e994c49dd
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 7 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/55857/1

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 063b80b..ac3d75d 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -737,20 +737,13 @@
 
         futureMaster = sdCache.produce(msdUUID)
 
-        # @deprecated, domain version < 3
-        # For backward compatibility we must support a reconstructMaster
-        # that doesn't specify an hostId.
-        if not hostId:
-            self._acquireTemporaryClusterLock(msdUUID, leaseParams)
-            temporaryLock = True
-        else:
-            # Forcing to acquire the host id (if it's not acquired already).
-            futureMaster.acquireHostId(hostId)
-            futureMaster.acquireClusterLock(hostId)
+        # Forcing to acquire the host id (if it's not acquired already).
+        futureMaster.acquireHostId(hostId)
+        futureMaster.acquireClusterLock(hostId)
 
-            # The host id must be set for createMaster(...).
-            self.id = hostId
-            temporaryLock = False
+        # The host id must be set for createMaster(...).
+        self.id = hostId
+
         try:
             # As in the create method we need to temporarily set the object
             # secure in order to change the domains map.
@@ -773,11 +766,7 @@
             finally:
                 self._setUnsecure()
         finally:
-            if temporaryLock:
-                self._releaseTemporaryClusterLock(msdUUID)
-                self.stopMonitoringDomains()
-            else:
-                futureMaster.releaseClusterLock()
+            futureMaster.releaseClusterLock()
 
     def _copyLeaseParameters(self, srcDomain, dstDomain):
         leaseParams = srcDomain.getLeaseParams()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaffbb563532a40f67f33fd971f55724e994c49dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>


More information about the vdsm-patches mailing list