Change in vdsm[master]: deactivateSD - perform nothing if the domain is already deac...

nsoffer at redhat.com nsoffer at redhat.com
Thu Dec 12 15:43:03 UTC 2013


Nir Soffer has posted comments on this change.

Change subject: deactivateSD - perform nothing if the domain is already deactivated
......................................................................


Patch Set 1:

(3 comments)

....................................................
Commit Message
Line 7: deactivateSD - perform nothing if the domain is already deactivated
Line 8: 
Line 9: When calling deactivateSD with an already deactivated domain, there's no need
Line 10: to perform all the given operations (including mount) - if it's already
Line 11: deactivated, we can silently ignore like done in activateSD.
Why is this change needed?

What happens today when domain is deactivated in this flow?
Line 12: 
Line 13: Change-Id: I927557637cc6588dae832427018f6ac304f0a562


....................................................
File vdsm/storage/sp.py
Line 1143: 
Line 1144:         if sdUUID not in domList:
Line 1145:             raise se.StorageDomainNotInPool(self.spUUID, sdUUID)
Line 1146: 
Line 1147:         if domList[sdUUID] == sd.DOM_ATTACHED_STATUS:
A log.debug "domain xxxx-yyy is already deactivated" would be nice here. If this should not happen in normal flow, a warning is needed.
Line 1148:             return True
Line 1149: 
Line 1150:         try:
Line 1151:             dom = sdCache.produce(sdUUID)


Line 1185:                         self.log.error("Can't umount masterDir %s for domain "
Line 1186:                                        "%s", masterDir, dom)
Line 1187: 
Line 1188:         domList[sdUUID] = sd.DOM_ATTACHED_STATUS
Line 1189:         self.setMetaParam(PMDK_DOMAINS, domList)
It this fails, we may be left with active domain registered as inactive. Before this change, this would not matter because the second deactivate call would try again to set the meta data, and may succeed.

If we want to exit early when domain is already deactivated, we should swap these lines:

    self.setMetaParam(PMDK_DOMAINS, domList)
    domList[sdUUID] = sd.DOM_ATTACHED_STATUS
Line 1190:         self.updateMonitoringThreads()
Line 1191: 
Line 1192:     @unsecured
Line 1193:     def _linkStorageDomain(self, src, linkName):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I927557637cc6588dae832427018f6ac304f0a562
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list