Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

ewarszaw at redhat.com ewarszaw at redhat.com
Wed Aug 21 01:31:12 UTC 2013


Eduardo has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
......................................................................


Patch Set 1:

(2 comments)

....................................................
File vdsm/storage/hsm.py
Line 1525:             # hence no need to create fake template if postZero is true.
Line 1526:             self._spmSchedule(spUUID, "zeroImage_%s" % imgUUID, dom.zeroImage,
Line 1527:                               sdUUID, imgUUID, volsByImg)
Line 1528:         else:
Line 1529:             dom.deleteImage(sdUUID, imgUUID, volsByImg)
We want to avoid _reading_ this metadata.
We need to write it anyway using the more standard methods.
This is for backward compatibility and makes easier to get rid from the irrelevant fake volume concept at all.
Line 1530:             # This is a hack to keep the interface consistent
Line 1531:             # We currently have race conditions in delete image, to quickly fix
Line 1532:             # this we delete images in the "synchronous" state. This only works
Line 1533:             # because Engine does not send two requests at a time. This hack is


Line 1536:             # an eliminate all race conditions
Line 1537:             if needFake:
Line 1538:                 img = image.Image(os.path.join(self.storage_repository,
Line 1539:                                                spUUID))
Line 1540:                 tName = volsByImg.keys()[0]
As said above the issue is that is a must, for BC, to _write_ the MD but we want this code to be independent to the MD content, avoiding to read it.
Line 1541:                 tParams = dom.produceVolume(imgUUID, tName).getVolumeParams()
Line 1542:                 img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
Line 1543:             self._spmSchedule(spUUID, "deleteImage_%s" % imgUUID, lambda: True)
Line 1544: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce 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