Adam Litke has uploaded a new change for review.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
sdc: Allow StorageDomainCache to cache StorageDomainManifest objects
When HSM is operating without SPM the system should always be using StorageDomainManifest objects instead of StorageDomains. With this patch we can instruct the cache to serve the correct type of object without changing all consumers of sdCache.
Change-Id: I9a3dc7d9bf24f7d8b60ddff6f5364b65a9354e45 Signed-off-by: Adam Litke alitke@redhat.com --- M vdsm/storage/sdc.py 1 file changed, 12 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/44041/1
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py index ecb9708..cbdaed9 100644 --- a/vdsm/storage/sdc.py +++ b/vdsm/storage/sdc.py @@ -64,12 +64,13 @@ STORAGE_STALE = 1 STORAGE_REFRESHING = 2
- def __init__(self, storage_repo): + def __init__(self, storage_repo, use_manifests=False): self._syncroot = threading.Condition() self.__domainCache = {} self.__inProgress = set() self.__staleStatus = self.STORAGE_STALE self.storage_repo = storage_repo + self.use_manifests = use_manifests self.knownSDs = {} # {sdUUID: mod.findDomain}
def invalidateStorage(self): @@ -162,12 +163,18 @@ # this changes, please update the order. for mod in (blockSD, glusterSD, localFsSD, nfsSD): try: - return mod.findDomain(sdUUID) + if self.use_manifests: + ret = mod.findDomainManifest(sdUUID) + else: + ret = mod.findDomain(sdUUID) except se.StorageDomainDoesNotExist: pass except Exception: self.log.error("Error while looking for domain `%s`", sdUUID, exc_info=True) + else: + self.log.debug("Found domain %s", ret) + return ret
raise se.StorageDomainDoesNotExist(sdUUID)
@@ -181,10 +188,12 @@
return uuids
- def refresh(self): + def refresh(self, use_manifests=None): with self._syncroot: lvm.invalidateCache() self.__domainCache.clear() + if use_manifests is not None: + self.use_manifests = use_manifests
def manuallyAddDomain(self, domain): with self._syncroot:
automation@ovirt.org has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Adam Litke has abandoned this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Abandoned
not needed
gerrit-hooks has posted comments on this change.
Change subject: sdc: Allow StorageDomainCache to cache StorageDomainManifest objects ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org