Change in vdsm[master]: sp: fix spm start when failing to produce domain

laravot at redhat.com laravot at redhat.com
Wed Mar 5 13:57:20 UTC 2014


Liron Ar has uploaded a new change for review.

Change subject: sp: fix spm start when failing to produce domain
......................................................................

sp: fix spm start when failing to produce domain

During spmStart we attept to go over all the domains and set their role
to be regular in case it's not to avoid situation in which there are two
domains with the master role.
If we fail to produce any of the domains (which might happen, the
domains returned by getDomains(activeOnly=True) are all the domains that
are are marked as active in the metadata, but it doesn't mean that they
are actually reachable and that calling produce() for the domain won't fail.

In case the we fail to call produce() on domain or failing to alter it's
role, it doesn't mean that spmStart should fail - otherwise we might
never succeed to start spm.

Change-Id: Ia4f34360770ca8c8741a50956d0cab92bcd9a810
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/25424/1

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index a63d074..df89c27 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -201,12 +201,17 @@
         for sdUUID in self.getDomains(activeOnly=True):
             if sdUUID == self.masterDomain.sdUUID:
                 continue
+            try:
+                domain = sdCache.produce(sdUUID)
 
-            domain = sdCache.produce(sdUUID)
-            if domain.getDomainRole() == sd.REGULAR_DOMAIN:
-                continue
+                if domain.getDomainRole() == sd.REGULAR_DOMAIN:
+                    continue
 
-            self._backend.setDomainRegularRole(domain)
+                self._backend.setDomainRegularRole(domain)
+            except Exception:
+                # log any exception, but keep going
+                self.log.error("Error trying to check/update domain %s role",
+                               sdUUID, exc_info=True)
 
     @unsecured
     def startSpm(self, prevID, prevLVER, maxHostID, expectedDomVersion=None):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4f34360770ca8c8741a50956d0cab92bcd9a810
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot at redhat.com>


More information about the vdsm-patches mailing list