Change in vdsm[master]: [WIP] Replace SPM domain locks with Sanlock
by Yotam Oron
Yotam Oron has posted comments on this change.
Change subject: [WIP] Replace SPM domain locks with Sanlock
......................................................................
Patch Set 2: (1 inline comment)
....................................................
File vdsm/storage/safelease.py
Line 108: def initLock(self):
Fair enough, you can add an argument to the __init__ function
--
To view, visit http://gerrit.usersys.redhat.com/678
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3958a171e35d65544e0f2c3593daaf7daf8750ef
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Eduardo Warszawski <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yotam Oron <yoron(a)redhat.com>
12 years, 8 months
Change in vdsm[master]: [WIP] Replace SPM domain locks with Sanlock
by Federico Simoncelli
Federico Simoncelli has posted comments on this change.
Change subject: [WIP] Replace SPM domain locks with Sanlock
......................................................................
Patch Set 2: (6 inline comments)
....................................................
File vdsm/storage/blockSD.py
Line 593: lvm.activateLVs(self.sdUUID, [sd.IDS])
Where should I activate? Look few lines below: _getLeasesFilePath.
....................................................
File vdsm/storage/safelease.py
Line 93: class ClusterLock(object):
We know this, I'm waiting for instruction about how to integrate this in the existing datacenters. At the moment this is useful for testing (and comparison with old code).
Line 108: def initLock(self):
A new ClusterLock object is instantiated every time you connect to a domain. That doesn't mean you need to "init" it every time. It's needed only the first time. This is part of the current API of ClusterLock. (Look at the old implementation up above).
....................................................
File vdsm/storage/sd.py
Line 333: def initSPMlease(self):
See the initLock comment.
....................................................
File vdsm/storage/sp.py
Line 281: self.id = 250
This is a phony id we use to take actions on a domain that is not connected to any pool yet (eg: on creation).
....................................................
File vdsm/storage/storage_exception.py
Line 1172: message = "Cannot obtain lock"
I don't know. I simply changed "Could not" to "Cannot" for consistency.
--
To view, visit http://gerrit.usersys.redhat.com/678
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3958a171e35d65544e0f2c3593daaf7daf8750ef
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Eduardo Warszawski <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yotam Oron <yoron(a)redhat.com>
12 years, 8 months
[NEW PATCH] Related to 732275 - Simplify getMasterDomain(). (via gerrit-bot)
by ewarszaw@redhat.com
New patch submitted by Eduardo Warszawski (ewarszaw(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/902
commit dfcfe3a0a21ff7912cb2a1c5bd5352017d2f6f29
Author: Eduardo Warszawski <ewarszaw(a)redhat.com>
Date: Tue Sep 6 12:21:42 2011 +0300
Related to 732275 - Simplify getMasterDomain().
Unveil the behaviour of getMasterDomain() without parameters.
verifyMasterDomain() can't return None.
Change-Id: Ie2d397a81516f9025bd6c8da6ce25d4b052e3ed7
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index aa4d6aa..730898a 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1319,7 +1319,7 @@ class HSM:
# make sure it's THE master
try:
pool = self.getPool(dom.getPools()[0])
- master = pool.getMasterDomain()
+ master = pool.masterDomain
if master.sdUUID == sdUUID:
poolInfo = pool.getInfo()
for key in ['lver', 'spm_id', 'master_ver']:
@@ -1867,7 +1867,7 @@ class HSM:
for p in self.pools.values():
# Find the master domains
try:
- master = p.getMasterDomain()
+ master = p.masterDomain
except se.StorageException:
self.log.error("Unexpected error", exc_info=True)
master = None
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 014da1e..95982d8 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -207,11 +207,11 @@ class StoragePool:
return self.getMetaParam(PMDK_MASTER_VER)
def acquireClusterLock(self):
- msd = self.getMasterDomain()
+ msd = self.masterDomain
msd.acquireClusterLock(self.id)
def releaseClusterLock(self):
- self.getMasterDomain().releaseClusterLock()
+ self.masterDomain.releaseClusterLock()
def validateAttachedDomain(self, sdUUID):
domList = self.getDomains()
@@ -235,15 +235,16 @@ class StoragePool:
exception if masterVersion doesn't follow the rules
"""
- d = self.getMasterDomain()
+ d = self.masterDomain
mver = self.getMasterVersion()
if not int(masterVersion) > mver:
raise se.StoragePoolWrongMaster(self.spUUID, d.sdUUID)
def getMaximumSupportedDomains(self):
- msdType = sd.name2type(self.getMasterDomain().getInfo()["type"])
- msdVersion = int(self.getMasterDomain().getInfo()["version"])
+ msdInfo = self.masterDomain.getInfo()
+ msdType = sd.name2type(msdInfo["type"])
+ msdVersion = int(msdInfo["version"])
if msdType in sd.BLOCK_DOMAIN_TYPES and msdVersion in blockSD.VERS_METADATA_LV:
return MAX_DOMAINS
else:
@@ -699,7 +700,7 @@ class StoragePool:
# If the domain being detached is the 'master', move all pool
# metadata to the new 'master' domain (msdUUID)
- if sdUUID == self.getMasterDomain().sdUUID:
+ if sdUUID == self.masterDomain.sdUUID:
self.masterMigrate(sdUUID, msdUUID, masterVersion)
# Remove pool info from domain metadata
@@ -905,7 +906,7 @@ class StoragePool:
master domain will be updated.
"""
if sdUUID is None:
- sdUUID = self.getMasterDomain().sdUUID
+ sdUUID = self.masterDomain.sdUUID
self.log.info("spUUID=%s sdUUID=%s", self.spUUID, sdUUID)
vms = self._getVMsPath(sdUUID)
@@ -974,7 +975,7 @@ class StoragePool:
@property
def _metadata(self):
- master = self.getMasterDomain()
+ master = self.masterDomain
return self._getPoolMD(master)
def getDescription(self):
@@ -987,7 +988,7 @@ class StoragePool:
return ""
def getVersion(self):
- return self.getMasterDomain().getVersion()
+ return self.masterDomain.getVersion()
def getInfo(self):
"""
@@ -1004,7 +1005,7 @@ class StoragePool:
msdUUID = None
try:
- master = self.getMasterDomain()
+ master = self.masterDomain
msdUUID = master.sdUUID
msdInfo = master.getInfo()
except Exception:
@@ -1110,16 +1111,11 @@ class StoragePool:
"""
return self._metadata[key]
- def getMasterDomain(self, msdUUID=None, masterVersion=None):
+ def getMasterDomain(self, msdUUID, masterVersion):
# Either we have in cache or we got non blank msdUUID,
# no other option should be supported
- if msdUUID and msdUUID != sd.BLANK_UUID:
- self.masterDomain = self.verifyMasterDomain(msdUUID=msdUUID, masterVersion=masterVersion)
- self.log.debug("Master domain '%s' verified", self.masterDomain)
-
- if not self.masterDomain:
- self.log.error("Couldn't find master domain for pool %s", self.spUUID, exc_info=True)
- raise se.StoragePoolMasterNotFound(self.spUUID, str(msdUUID))
+ self.masterDomain = self.verifyMasterDomain(msdUUID=msdUUID, masterVersion=masterVersion)
+ self.log.debug("Master domain '%s' verified", self.masterDomain)
return self.masterDomain
@@ -1251,7 +1247,7 @@ class StoragePool:
vmPath = SDF.produce(sdUUID).getVMsDir()
# Get VMs path from the pool (from the master domain)
else:
- vmPath = self.getMasterDomain().getVMsDir()
+ vmPath = self.masterDomain.getVMsDir()
if not os.path.exists(vmPath):
raise se.VMPathNotExists(vmPath)
@@ -1262,7 +1258,7 @@ class StoragePool:
baddomains = {}
message = "Pool OK"
try:
- masterdomain = self.getMasterDomain()
+ masterdomain = self.masterDomain
self.invalidateMetadata()
spmId = self.getMetaParam(PMDK_SPM_ID)
domains = self.getDomains(activeOnly=True)
diff --git a/vdsm/storage/spm.py b/vdsm/storage/spm.py
index ae55e44..398da4b 100644
--- a/vdsm/storage/spm.py
+++ b/vdsm/storage/spm.py
@@ -368,7 +368,7 @@ class SPM:
sd.validateDomainVersion(targetDomVersion)
pool = hsm.HSM.getPool(spUUID)
- masterDom = pool.getMasterDomain()
+ masterDom = pool.masterDomain
sdUUID = masterDom.sdUUID
self.log.info("Trying to upgrade master domain `%s`", sdUUID)
with rmanager.acquireResource(STORAGE, masterDom.sdUUID, rm.LockType.exclusive):
@@ -405,7 +405,7 @@ class SPM:
#Assumed that the domain can be attached only to one pool
poolUUID = domain.getPools()[0]
pool = hsm.HSM.getPool(poolUUID)
- masterDom = pool.getMasterDomain()
+ masterDom = pool.masterDomain
targetDomVersion = masterDom.getVersion()
except:
self.log.error("Error while preparing domain `%s` upgrade", sdUUID, exc_info=True)
@@ -480,7 +480,7 @@ class SPM:
pool = hsm.HSM.getPool(spUUID)
pool.updateMonitoringThreads()
pool.invalidateMetadata()
- masterDom = pool.getMasterDomain()
+ masterDom = pool.masterDomain
oldlver = pool.getMetaParam(sp.PMDK_LVER)
oldid = pool.getMetaParam(sp.PMDK_SPM_ID)
masterDomVersion = pool.getVersion()
@@ -1052,7 +1052,7 @@ class SPM:
vars.task.setDefaultException(se.StorageDomainActionError("sdUUID=%s, spUUID=%s" % (str(sdUUID), str(spUUID))))
vars.task.getExclusiveLock(STORAGE, spUUID)
pool = hsm.HSM.getPool(spUUID)
- if sdUUID == pool.getMasterDomain().sdUUID:
+ if sdUUID == pool.masterDomain.sdUUID:
raise se.CannotDetachMasterStorageDomain(sdUUID)
pool.forcedDetachSD(sdUUID)
@@ -1087,7 +1087,7 @@ class SPM:
Detach all domains from pool before destroying pool
"""
# First find out this pool master domain
- mDom = pool.getMasterDomain()
+ mDom = pool.masterDomain
# Find out domain list from the pool metadata
domList = pool.getDomains().keys()
@@ -1372,7 +1372,7 @@ class SPM:
vars.task.getSharedLock(STORAGE, sdUUID)
if sdUUID == None:
- dom = self.getPool(spUUID).getMasterDomain()
+ dom = self.getPool(spUUID).masterDomain
else:
dom = SDF.produce(sdUUID)
12 years, 8 months
Change in vdsm[master]: [WIP] Replace SPM domain locks with Sanlock
by Yotam Oron
Yotam Oron has posted comments on this change.
Change subject: [WIP] Replace SPM domain locks with Sanlock
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File vdsm/storage/safelease.py
Line 108: def initLock(self):
This function seems redundant.
It can be merged into the __init__ and the calls to it can be removed.
....................................................
File vdsm/storage/sd.py
Line 333: def initSPMlease(self):
If you remove initLock from safelease.py, this function can go away too.
....................................................
File vdsm/storage/sp.py
Line 281: self.id = 250
This is possible since we can only be connected to one pool, right ?
....................................................
File vdsm/storage/storage_exception.py
Line 1172: message = "Cannot obtain lock"
Why 'obtain' and not 'acquire' ?
--
To view, visit http://gerrit.usersys.redhat.com/678
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3958a171e35d65544e0f2c3593daaf7daf8750ef
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Eduardo Warszawski <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yotam Oron <yoron(a)redhat.com>
12 years, 8 months
Change in vdsm[master]: Synchronize libvirtconnection.get()
by David Naori
David Naori has posted comments on this change.
Change subject: Synchronize libvirtconnection.get()
......................................................................
Patch Set 2: (1 inline comment)
....................................................
Commit Message
Line 9: I'd like to consider making _ongoingCreation bigger than 1, and to make
Fix English: drop the make?
--
To view, visit http://gerrit.usersys.redhat.com/904
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8d682d8cb1945f7d01008de84b20bf7893d68a1f
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: David Naori <dnaori(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
12 years, 8 months
Change in vdsm[master]: Synchronize libvirtconnection.get()
by Igor Lvovsky
Igor Lvovsky has posted comments on this change.
Change subject: Synchronize libvirtconnection.get()
......................................................................
Patch Set 2:
Did you verified it with multiple VM creation?
For example create VM pool
--
To view, visit http://gerrit.usersys.redhat.com/904
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8d682d8cb1945f7d01008de84b20bf7893d68a1f
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
12 years, 8 months
Change in vdsm[master]: Synchronize libvirtconnection.get()
by Igor Lvovsky
Igor Lvovsky has posted comments on this change.
Change subject: Synchronize libvirtconnection.get()
......................................................................
Patch Set 2: Looks good to me, but someone else must approve
--
To view, visit http://gerrit.usersys.redhat.com/904
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8d682d8cb1945f7d01008de84b20bf7893d68a1f
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
12 years, 8 months
[NEW PATCH] Related to BZ#723579 - OOP Handlers shouldn't print to stdout on failure (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/914
commit d4f812f405a7d74e4b576a187807edc9c21847b1
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Thu Sep 8 11:27:26 2011 +0300
Related to BZ#723579 - OOP Handlers shouldn't print to stdout on failure
Change-Id: I7373f2f463252c8ce6302b123b5d60166aa40d48
diff --git a/vdsm/storage/processPool.py b/vdsm/storage/processPool.py
index 2a2d364..74079bc 100644
--- a/vdsm/storage/processPool.py
+++ b/vdsm/storage/processPool.py
@@ -176,22 +176,27 @@ def _helperMainLoop(pipe, lifeLine, parentLifelineFD):
poller.register(lifeLine, 0) # Only SIGERR\SIGHUP
poller.register(pipe.fileno(), select.EPOLLIN | select.EPOLLPRI)
- while True:
+ try:
+ while True:
- for (fd, event) in poller.poll():
- # If something happened in lifeLine, it means that papa is gone
- # and we should go as well
- if fd == lifeLine or event in (select.EPOLLHUP, select.EPOLLERR):
- return
-
- func, args, kwargs = pipe.recv()
- res = err = None
- try:
- res = func(*args, **kwargs)
- except KeyboardInterrupt as ex:
- err = ex
- except Exception as ex:
- err = ex
+ for (fd, event) in poller.poll():
+ # If something happened in lifeLine, it means that papa is gone
+ # and we should go as well
+ if fd == lifeLine or event in (select.EPOLLHUP, select.EPOLLERR):
+ return
- pipe.send((res, err))
+ func, args, kwargs = pipe.recv()
+ res = err = None
+ try:
+ res = func(*args, **kwargs)
+ except KeyboardInterrupt as ex:
+ err = ex
+ except Exception as ex:
+ err = ex
+
+ pipe.send((res, err))
+ except:
+ # If for some reason communication with the host failed crash silently
+ # There is no logging in oop and VDSM will handle it.
+ pass
12 years, 8 months
Change in vdsm[master]: Use python -m to load supervdsmserver
by smizrahi@redhat.com
Saggi Mizrahi has posted comments on this change.
Change subject: Use python -m to load supervdsmserver
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File vdsm/supervdsm.py
Line 37:
Grrraaaaa
Line 73: pythonpath = os.path.abspath(os.path.dirname(__file__))
It would require a change in the source code for that to happen. If a patch moves this it'll have to change this as well.
--
To view, visit http://gerrit.usersys.redhat.com/870
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9ad081631512896ed1be658328b318984d6c8ff1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yotam Oron <yoron(a)redhat.com>
12 years, 8 months