Change in vdsm[master]: detach: Support force detach on Storage Domains with old pools.
nsoffer at redhat.com
nsoffer at redhat.com
Thu Jun 26 14:38:17 UTC 2014
Nir Soffer has posted comments on this change.
Change subject: detach: Support force detach on Storage Domains with old pools.
......................................................................
Patch Set 12:
(3 comments)
http://gerrit.ovirt.org/#/c/29042/12/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:
Line 746: # We are called with blank pool uuid, to avoid changing exiting
Line 747: # API which we want to drop in next version anyway.
Line 748: # So to get the pool we use the fact that there can be only one
Line 749: # pool, and get the host id from it.
Line 750: assert len(self.pools) <= 1
> "An assertion is a sanity-check that you can turn on or turn off when you a
So to make it clear what should be changed:
1. Replace the assert with:
if len(self.pools) > 1:
raise AssertionError("Multiple pools are not supported")
Why: so this error is raised even when running with python -O and assert statements are optimized out.
2. If we don't have a pool, raise nicer error:
try:
pool = self.pools.values()[0]
except IndexError:
raise se.StoragePoolNotConnected()
Why: this allows engine to fail with nice error message instead of generic error message..
Line 751: pool = self.pools.values()[0]
Line 752:
Line 753: dom = sdCache.produce(sdUUID=sdUUID)
Line 754: dom.acquireHostId(pool.id)
Line 748: # So to get the pool we use the fact that there can be only one
Line 749: # pool, and get the host id from it.
Line 750: assert len(self.pools) <= 1
Line 751: pool = self.pools.values()[0]
Line 752:
> Not sure if:
Lets take the domain lock, just to be on the safe side:
vars.task.getExclusiveLock(STORAGE, sdUUID)
Line 753: dom = sdCache.produce(sdUUID=sdUUID)
Line 754: dom.acquireHostId(pool.id)
Line 755: try:
Line 756: dom.acquireClusterLock(pool.id)
Line 772: """
Line 773: vars.task.setDefaultException(
Line 774: se.StorageDomainActionError(
Line 775: "sdUUID=%s, spUUID=%s" % (sdUUID, spUUID)))
Line 776: vars.task.getExclusiveLock(STORAGE, spUUID)
> This may have to go in line 781.
Ok
Line 777:
Line 778: if spUUID == sd.BLANK_UUID:
Line 779: self._deatchStorageDomainFromOldPools(sdUUID)
Line 780: else:
--
To view, visit http://gerrit.ovirt.org/29042
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4a6fb01775f7c834a3466e45b9b7ed9b4bd5c3be
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list