Saggi Mizrahi has posted comments on this change.
Change subject: Avoid unnecesary produce-invalidate-produce on SD conf changes. ......................................................................
Patch Set 1: (6 inline comments)
.................................................... File vdsm/storage/sp.py Line 530: def releaseClusterLock(self): Line 531: self.masterDomain.releaseClusterLock() Line 532: Line 533: @unsecured Line 534: def validateNewDomainConf(self, sdUUID, nextState): This function doesn 3 things. Line 535: domainConfs = self.getDomains() Line 536: Line 537: if sdUUID not in domainConfs.iterkeys(): Line 538: raise se.StorageDomainNotInPool(self.spUUID, sdUUID)
Line 536: Line 537: if sdUUID not in domainConfs.iterkeys(): Line 538: raise se.StorageDomainNotInPool(self.spUUID, sdUUID) Line 539: currState = domainConfs[sdUUID] Line 540: #TODO: remove this validate when 2.2 domains are obsolete This will not change in 3.1 domains. It'll only change when pool is removed Line 541: if nextState not in sd.DOMAIN_TRANSITIONS[currState]: Line 542: raise se.StorageDomainStateTransitionIllegal(sdUUID, currState, nextState) Line 543: Line 544: # Avoid handle domains if not owned by pool
Line 537: if sdUUID not in domainConfs.iterkeys(): Line 538: raise se.StorageDomainNotInPool(self.spUUID, sdUUID) Line 539: currState = domainConfs[sdUUID] Line 540: #TODO: remove this validate when 2.2 domains are obsolete Line 541: if nextState not in sd.DOMAIN_TRANSITIONS[currState]: Check if this is really needed Line 542: raise se.StorageDomainStateTransitionIllegal(sdUUID, currState, nextState) Line 543: Line 544: # Avoid handle domains if not owned by pool Line 545: dom = sdCache.produce(sdUUID)
Line 541: if nextState not in sd.DOMAIN_TRANSITIONS[currState]: Line 542: raise se.StorageDomainStateTransitionIllegal(sdUUID, currState, nextState) Line 543: Line 544: # Avoid handle domains if not owned by pool Line 545: dom = sdCache.produce(sdUUID) No more produce outside of hsm. You can use old ones but try to refrain from adding more. Line 546: pools = dom.getPools() Line 547: if self.spUUID not in pools: Line 548: raise se.StorageDomainNotInPool(self.spUUID, sdUUID) Line 549: # domList[sdUUID] = domConfiguration = [active, attached]
Line 547: if self.spUUID not in pools: Line 548: raise se.StorageDomainNotInPool(self.spUUID, sdUUID) Line 549: # domList[sdUUID] = domConfiguration = [active, attached] Line 550: # Formerly know as status Line 551: return (dom, domainConfs) You return unrelated data get this as an arg if the outside function needs this Line 552: Line 553: @unsecured Line 554: def validatePoolMVerHigher(self, masterVersion): Line 555: """
Line 1029: self.log.info("sdUUID=%s spUUID=%s msdUUID=%s", sdUUID, self.spUUID, msdUUID) Line 1030: Line 1031: try: Line 1032: # Avoid detach domains if not owned by pool Line 1033: dom, domConfs = self.validateNewDomainConf(sdUUID, sd.DOM_UNATTACHED_STATUS) domConfs is not clear, I agree that state is not really what it is but we all know what it means. Line 1034: Line 1035: # If the domain being detached is the 'master', move all pool Line 1036: # metadata to the new 'master' domain (msdUUID) Line 1037: if sdUUID == self.masterDomain.sdUUID:
-- To view, visit http://gerrit.usersys/1081 To unsubscribe, visit http://gerrit.usersys/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If5165b92974145bcd26ca50648a65a6bfe282eb6 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com
vdsm-patches@lists.fedorahosted.org