Liron Ar has submitted this change and it was merged.

Change subject: core: avoid deadlock in images
......................................................................


core: avoid deadlock in images

Currently the images table contains a foreign key to itself (quoting from
the table definition) :
    ...
    TABLE "images" CONSTRAINT "image_templates_images" FOREIGN KEY
    (it_guid) REFERENCES images(image_guid)
    ...

The column it_guid in the images table indicates what is the template
that the image is based on.

In postgres versions earlier than 9.3, when executing a update to a row
with a foreign key, a lock on the referenced record is taken which means
that we have a chance for a deadlock in the following scenarios:
1. Simultenous update to the template disks and to the disks of a vm
based on the template.

2. Simultenous update to disks of vms based on the same template.

This issue has been resolved in postgres 9.3
(http://www.postgresql.org/docs/9.3/static/release-9-3.html see
E.5.3.1.1), till we'll enforce usage of that version we can drop that foreign
key constraint which will also align it with the parentid column that we don't
a FK on as well.

Regardless of that, we should remove unneeded updates to images in
different flows.

Change-Id: Ib4939a716cef8901b53a90499201d815a4e3cb58
Bug-Url: https://bugzilla.redhat.com/1077715
Signed-off-by: Liron Aravot <[email protected]>
---
A packaging/dbscripts/upgrade/03_05_0600_drop_images_fk.sql
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Liron Ar: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4939a716cef8901b53a90499201d815a4e3cb58
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: [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