Change in vdsm[master]: sp: update domain links on state change

Federico Simoncelli fsimonce at redhat.com
Fri May 2 21:32:45 UTC 2014


Federico Simoncelli has uploaded a new change for review.

Change subject: sp: update domain links on state change
......................................................................

sp: update domain links on state change

In some situations (e.g. after a reconstructMaster command) the
domain links may be missing and it's impossible to recreate them
on connectStoragePool or refreshStoragePool since the storage may
be unreachable. The best we can do is recreate them as soon as
the domains are visible again.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1091030
Change-Id: I7ac20e4b515472b24c35b2cccd2ad3dc98b3574c
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/27334/1

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 4a07c6a..6b12e44 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -104,6 +104,10 @@
         self.domainMonitor = domainMonitor
         self._upgradeCallback = partial(StoragePool._upgradePoolDomain,
                                         proxy(self))
+        self._domainStateCallback = partial(
+            StoragePool._domainStateChange, proxy(self))
+        self.domainMonitor.onDomainStateChange.register(
+            self._domainStateCallback)
         self._backend = None
 
     def __is_secure__(self):
@@ -137,6 +141,10 @@
     def getBackend(self):
         return self._backend
 
+    def _domainStateChange(self, sdUUID, isValid):
+        if isValid and sdUUID in self.getDomains():
+            self._refreshDomainLinks(sdCache.produce(sdUUID))
+
     def _upgradePoolDomain(self, sdUUID, isValid):
         # This method is called everytime the onDomainStateChange
         # event is emitted, this event is emitted even when a domain goes


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ac20e4b515472b24c35b2cccd2ad3dc98b3574c
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