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) we shouldn't fail,
as we attempt to produce all the domains that 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 with
StorageDomainDoesNotExist exception, it doesn't mean that spmStart should
fail - otherwise we might never succeed to start spm.

I believe that we should ignore any exception to avoid the same case in
different scenarios (for example - failure to alter the metadata), but
as reviewers requested, let's start with StorageDomainDoesNotExist
exception only.

Change-Id: Ia4f34360770ca8c8741a50956d0cab92bcd9a810
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1072900
Signed-off-by: Liron Aravot <[email protected]>
---
M vdsm/storage/sp.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/27194/1

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 4bab1b9..1a87e84 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -201,8 +201,13 @@
         for sdUUID in self.getDomains(activeOnly=True):
             if sdUUID == self.masterDomain.sdUUID:
                 continue
+            try:
+                domain = sdCache.produce(sdUUID)
+            except se.StorageDomainDoesNotExist:
+                self.log.exception("Error producing domain %s, ignoring",
+                                   sdUUID)
+                continue
 
-            domain = sdCache.produce(sdUUID)
             if domain.getDomainRole() == sd.REGULAR_DOMAIN:
                 continue
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4f34360770ca8c8741a50956d0cab92bcd9a810
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Liron Ar <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to