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.
This patch has been submitted to the ovirt-3.4 branch only because it's not the
long-term solution that instead should be delivered by BZ#1093924.
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1086210
Relates-To:
https://bugzilla.redhat.com/show_bug.cgi?id=1093924
Change-Id: I7ac20e4b515472b24c35b2cccd2ad3dc98b3574c
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/27466/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 1a87e84..4d6a487 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/27466
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ac20e4b515472b24c35b2cccd2ad3dc98b3574c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>