Change in vdsm[master]: pool: ignore refreshStoragePool calls on the SPM

fsimonce at redhat.com fsimonce at redhat.com
Fri Dec 28 17:06:15 UTC 2012


Federico Simoncelli has uploaded a new change for review.

Change subject: pool: ignore refreshStoragePool calls on the SPM
......................................................................

pool: ignore refreshStoragePool calls on the SPM

The refreshStoragePool command is an HSM command and should not be
issued (and executed) on the SPM. At the moment we just ignore it
for legacy reasons but in the future vdsm could raise an exception.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=882958
Change-Id: I2c275bfb15e4948c2e28ea21fac787c36bb48e97
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/10450/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index efb2749..c28a1ee 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -786,8 +786,22 @@
             se.StoragePoolActionError(
                 "spUUID=%s, msdUUID=%s, masterVersion=%s" %
                 (spUUID, msdUUID, masterVersion)))
+
         vars.task.getSharedLock(STORAGE, spUUID)
+
+        try:
+            # The refreshStoragePool command is an HSM command and
+            # should not be issued (and executed) on the SPM. At the
+            # moment we just ignore it for legacy reasons but in the
+            # future vdsm could raise an exception.
+            self.validateNotSPM(spUUID)
+        except se.IsSpm:
+            self.log.info("Ignoring the refreshStoragePool request "
+                          "(the host is the SPM)")
+            return
+
         pool = self.getPool(spUUID)
+
         try:
             self.validateSdUUID(msdUUID)
             pool.refresh(msdUUID, masterVersion)
@@ -1010,12 +1024,12 @@
         self.validateNotSPM(spUUID)
 
         vars.task.getExclusiveLock(STORAGE, spUUID)
-        self.validateNotSPM(spUUID)
-
         pool = self.getPool(spUUID)
+
         return self._disconnectPool(pool, hostID, scsiKey, remove)
 
     def _disconnectPool(self, pool, hostID, scsiKey, remove):
+        self.validateNotSPM(pool.spUUID)
         res = pool.disconnect()
         del self.pools[pool.spUUID]
         return res


--
To view, visit http://gerrit.ovirt.org/10450
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c275bfb15e4948c2e28ea21fac787c36bb48e97
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list