Change in ovirt-engine[ovirt-engine-3.3]: core: avoid db deadlock and unneeded db updates for images

iheim at redhat.com iheim at redhat.com
Tue Dec 31 16:34:26 UTC 2013


Itamar Heim has submitted this change and it was merged.

Change subject: core: avoid db deadlock and unneeded db updates for images
......................................................................


core: avoid db deadlock and unneeded db updates for images

When adding a VM from template (as part of pool or not),
CreateSnapshotFromTemplateCommand is being executed and when the
operation ends its end method is being called for each of the disks.

In the end method there's an attempt to unlock the template image which
causes to numerous issues:
1. There are attempts to update the template disks statuses to ok,
as the updates aren't ordered and are executed for each added vm based
on that template - db deadlocks occur.
2.Currently the template disks aren't being locked at all (which
should be inspected regardless), so there's currently no point in unlocking them.

The fix which is introduced is to not update the image status if it's
already in the desired status, which will reduce the updates count in
general and will prevent possible db deadlocks in the provided
scenarios.

Change-Id: I26a09ce674cfefd59819f3edf95accab31f0e80e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1047163
Signed-off-by: Arik Hadas <ahadas at redhat.com>
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Omer Frenkel: Looks good to me, approved
  Arik Hadas: Verified
  Liron Ar: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I26a09ce674cfefd59819f3edf95accab31f0e80e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Liron Ar <laravot at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list