Liron Aravot has uploaded a new change for review. Change subject: sp: allow executing upgradePool even if there is a pending update ......................................................................
sp: allow executing upgradePool even if there is a pending update Currently when a pool upgrade is initated (either by startSpm() or by executing upgradePool() explicitly) the _domainsToUpgrade member of the storage pool is initiated with the active domains, when each domain upgrade is completed (or if the upgrade is unneeded) its id is removed from that list. When there is an unavailable domain, it'll remain on that list until its update is complete - while it's unavailable other upgrade can't be executed. This patch changes that, we should allow upgrading the pool even if an older upgrade wasn't complete yet - the domains that the old update wasn't completed yet for will be upgraded to the new version. Change-Id: I8e14a3aa33bfab4751ab5d1e3becbeda892da4c3 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1260428 Signed-off-by: Liron Aravot <lara...@redhat.com> --- M vdsm/storage/sp.py 1 file changed, 3 insertions(+), 23 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/57188/1 diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index ef15135..e04112c 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -175,8 +175,8 @@ exc_info=True) return - with rmanager.acquireResource(STORAGE, "upgrade_" + sdUUID, - rm.LockType.exclusive): + with rmanager.acquireResource(STORAGE, "upgrade_" + self.spUUID, + rm.LockType.shared): with rmanager.acquireResource(STORAGE, sdUUID, rm.LockType.exclusive): if sdUUID not in self._domainsToUpgrade: @@ -352,30 +352,13 @@ self.log.debug("Shutting down upgrade process") with rmanager.acquireResource(STORAGE, "upgrade_" + self.spUUID, rm.LockType.exclusive): - domains = self._domainsToUpgrade[:] try: self.domainMonitor.onDomainStateChange.unregister( self._upgradeCallback) except KeyError: pass - requests = [] - def cancelUpgrade(sdUUID, req, res): - try: - self._domainsToUpgrade.remove(sdUUID) - except ValueError: - pass - - res.release() - - for sdUUID in domains: - req = rmanager.registerResource(STORAGE, "upgrade_" + sdUUID, - rm.LockType.exclusive, - partial(cancelUpgrade, sdUUID)) - requests.append(req) - - for req in requests: - req.wait() + self._domainsToUpgrade = [] @classmethod def cleanupMasterMount(cls): @@ -439,9 +422,6 @@ def _upgradePool(self, targetDomVersion): with rmanager.acquireResource(STORAGE, "upgrade_" + self.spUUID, rm.LockType.exclusive): - if len(self._domainsToUpgrade) > 0: - raise se.PoolUpgradeInProgress(self.spUUID) - sd.validateDomainVersion(targetDomVersion) self.log.info("Trying to upgrade master domain `%s`", self.masterDomain.sdUUID) -- To view, visit https://gerrit.ovirt.org/57188 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e14a3aa33bfab4751ab5d1e3becbeda892da4c3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Liron Aravot <lara...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches