Daniel Erez has posted comments on this change.
Change subject: hsm: deleteImage - lock image by imgUUID and sdUUID
......................................................................
Patch Set 1:
(2 comments)
http://gerrit.ovirt.org/#/c/28264/1//COMMIT_MSG
Commit Message:
Line 9: hsm -> deleteImage:
Line 10: An image can reside on two storage domains concurrently
Line 11: (e.g. during LSM flow: between syncImage and deleteImage phases).
Line 12: Hence, deleting an image should take an exclusive lock on both
Line 13: image and storage domain IDs.
Do you mean that since the image exists on two storage domains, we
cannot t
Done
Line 14:
Line 15: Change-Id: I057b1f680276b1eb8a5d910260b7db4c4236fbf5
Line 16: Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1097648
http://gerrit.ovirt.org/#/c/28264/1/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:
Line 1464: """
Line 1465: # vars.task.setDefaultException(se.ChangeMeError("%s" %
args))
Line 1466: pool = self.getPool(spUUID)
Line 1467: dom = sdCache.produce(sdUUID=sdUUID)
Line 1468:
Please comment here why we take a lock on both image and domain
uuids, and
Added a comment. Do you think a BZ number is mandatory here? I
personally don't like to flood the code with bugs numbers. After all, Bugzilla is not
a documentation system... so, I don't think our code should be described by bugs
unless we're doing some really hacky/confusing trick or workaround (to me it makes
sense to lock an image by its ID and SD).
Line 1469: vars.task.getExclusiveLock(STORAGE, "%s_%s", imgUUID,
sdUUID)
Line 1470: vars.task.getSharedLock(STORAGE, sdUUID)
Line 1471: allVols = dom.getAllVolumes()
Line 1472: volsByImg = sd.getVolsOfImage(allVols, imgUUID)
--
To view, visit
http://gerrit.ovirt.org/28264
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I057b1f680276b1eb8a5d910260b7db4c4236fbf5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes