Change in vdsm[master]: volume: remove domain shared lock from getVolumeSize

fsimonce at redhat.com fsimonce at redhat.com
Fri Oct 12 15:02:41 UTC 2012


Federico Simoncelli has uploaded a new change for review.

Change subject: volume: remove domain shared lock from getVolumeSize
......................................................................

volume: remove domain shared lock from getVolumeSize

During long operations that involve an exclusive lock on a storage
domain (e.g.: domain upgrade) the getVolumeSize calls coming from
the VmStatsThread are queued and the statsAge grows until the VMs
are moved to not-responding.

Removing the getSharedLock call from getVolumeSize is the safest
way to fix the issue since we don't use more granular locks during
the upgrade (image/volume locks) and the getVolumeSize call can
either succeed or fail without undesiderable side effects.

In this patch:
* remove the getSharedLock from getVolumeSize
* make the involved code pep8 compliant

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=865386
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
Change-Id: I644fff245b62ef009a4ca7b6f4a903c9ffcc9653
---
M vdsm/storage/hsm.py
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/8517/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 50d6ce1..85cb443 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2587,11 +2587,10 @@
         :returns: a dict with the size of the volume.
         :rtype: dict
         """
-        vars.task.getSharedLock(STORAGE, sdUUID)
+        apparentsize = volume.Volume.getVSize(sdUUID, imgUUID, volUUID, bs=1)
+        truesize = volume.Volume.getVTrueSize(sdUUID, imgUUID, volUUID, bs=1)
         # Return string because xmlrpc's "int" is very limited
-        apparentsize = str(volume.Volume.getVSize(sdUUID, imgUUID, volUUID, bs=1))
-        truesize = str(volume.Volume.getVTrueSize(sdUUID, imgUUID, volUUID, bs=1))
-        return dict(apparentsize=apparentsize, truesize=truesize)
+        return dict(apparentsize=str(apparentsize), truesize=str(truesize))
 
 
     @public


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I644fff245b62ef009a4ca7b6f4a903c9ffcc9653
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list