Change in ovirt-engine[master]: core: fix deadlock on update vm version

ofrenkel at redhat.com ofrenkel at redhat.com
Wed Jun 18 14:00:12 UTC 2014


Omer Frenkel has submitted this change and it was merged.

Change subject: core: fix deadlock on update vm version
......................................................................


core: fix deadlock on update vm version

When a new template version created,
all vms using 'latest' of the template are updated to the new version.
seems that the update of template child count inside the insertVmStatic
stored procedure caused deadlock in db, because it would do select
count(*) on the table, without taking any lock.

in this patch the insert/delete vm static stored procedures are changed
to take a lock on the template, and the update line changed to +1 / -1
instead of count(*), because of the lock, now it is safe to do.

Change-Id: I2dfdb556e66658c3ef630cf71fba5f902ea26862
Signed-off-by: Omer Frenkel <ofrenkel at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
M packaging/dbscripts/vms_sp.sql
2 files changed, 11 insertions(+), 11 deletions(-)

Approvals:
  Eli Mesika: Looks good to me, but someone else must approve
  Shahar Havivi: Looks good to me, approved
  Omer Frenkel: Verified
  Arik Hadas: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dfdb556e66658c3ef630cf71fba5f902ea26862
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Eli Mesika <elimesika at gmail.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list