Michael Kublin has posted comments on this change.

Change subject: core: WIP : RemoveImageDisk - race when updating snapshots ovf 
(#828192)
......................................................................


Patch Set 7: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java
Line 99:                 getCommandId()));
Line 100:         p.setEntityId(getParameters().getEntityId());
Line 101:         return 
AsyncTaskManager.getInstance().CreateTask(AsyncTaskType.deleteImage, p);
Line 102:     }
Line 103: 
Also, the removeImageCommand not always required a locks, change a code, in 
order to reflect such behaviour
Line 104:     private void removeImageFromDB() {
Line 105:         final DiskImage diskImage = getDiskImage();
Line 106: 
Line 107:         updateSnapshotConfigWithoutImage(diskImage.getId());


Line 165:     private void updateSnapshotConfigWithoutImage(Guid 
imageGroupToRemove) {
Line 166:         List<DiskImage> snapshotDisks = 
getDiskImageDao().getAllSnapshotsForImageGroup(imageGroupToRemove);
Line 167:         // shuffling the snapshots list so that every thread 
performing the command on same snapshots will try to
Line 168:         // acquire the locks on the snapshots in different order.
Line 169:         Collections.shuffle(snapshotDisks);
and u sure about these?
Line 170:         for (DiskImage snapshotDisk : snapshotDisks) {
Line 171:             NGuid vmSnapshotId = snapshotDisk.getvm_snapshot_id();
Line 172:             if (vmSnapshotId != null && 
!Guid.Empty.equals(vmSnapshotId.getValue())) {
Line 173:                 try {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iccb44f1aa9d204477955343167133849a4146753
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to