Bug 1077715 - [engine] exporting thin-provision vm and its template in parallel fails with deadlock in db
Summary: [engine] exporting thin-provision vm and its template in parallel fails with ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Liron Aravot
QA Contact: nlevinki
URL:
Whiteboard: storage
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-03-18 13:23 UTC by Gadi Ickowicz
Modified: 2019-04-28 14:19 UTC (History)
9 users (show)

Fixed In Version: ovirt-engine-3.5.0_beta
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-16 19:09:36 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine logs (156.34 KB, application/gzip)
2014-03-18 13:23 UTC, Gadi Ickowicz
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 28409 0 master MERGED core: avoid deadlock in images Never
oVirt gerrit 82149 0 master MERGED core: Restore image_templates_images constraint 2017-09-28 13:40:05 UTC

Description Gadi Ickowicz 2014-03-18 13:23:28 UTC
Created attachment 875940 [details]
engine logs

Description of problem:
Attempting to export a thin-provision vm with multiple disks and its template in parallel fails during endAction of exportVm with the following exception, and the vm and disks remain locked:

2014-03-18 14:39:30,890 ERROR [org.ovirt.engine.core.bll.CommandAsyncTask] (org.ovirt.thread.pool-4-thread-15) [within thread]: endAction for action type ExportVm threw an exception.: javax.ejb.EJBTransactionRolle
dbackException: CallableStatementCallback; SQL [{call updateimagestatus(?, ?)}]; ERROR: deadlock detected
  Detail: Process 9079 waits for ShareLock on transaction 13418; blocked by process 8489.
Process 8489 waits for ShareLock on transaction 13417; blocked by process 9079.
  Hint: See server log for query details.
  Where: SQL statement "SELECT 1 FROM ONLY "public"."images" x WHERE "image_guid" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x"
SQL statement "UPDATE images SET imageStatus =  $1  WHERE image_guid =  $2 "
PL/pgSQL function "updateimagestatus" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: deadlock detected
  Detail: Process 9079 waits for ShareLock on transaction 13418; blocked by process 8489.
Process 8489 waits for ShareLock on transaction 13417; blocked by process 9079.
  Hint: See server log for query details.
  Where: SQL statement "SELECT 1 FROM ONLY "public"."images" x WHERE "image_guid" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x"
SQL statement "UPDATE images SET imageStatus =  $1  WHERE image_guid =  $2 "
PL/pgSQL function "updateimagestatus" line 2 at SQL statement
       at .......

Version-Release number of selected component (if applicable):
rhevm-3.4.0-0.3.master.el6ev.noarch

How reproducible:
?

Steps to Reproduce:
1. Create template from a vm with multiple disks
2. Create vm from template (thin-provision, *not* clone)
3. Start exporting template
4. start exporting vm (dialog will display warning about template not existing on target domain -> click OK to start the export)

Actual results:
Fails to export vm

Expected results:
Should succeed in exporting vm and template in parallel

Additional info:

Comment 1 Allon Mureinik 2014-03-18 22:56:17 UTC
Seems as though iterating over the disks in the endAction should be sorted somehow.

Comment 2 Gadi Ickowicz 2014-08-07 12:45:58 UTC
verified on ovirt-engine-3.5.0-0.0.master.20140804172041.git23b558e.el6.noarch

Comment 5 Allon Mureinik 2015-02-16 19:09:36 UTC
RHEV-M 3.5.0 has been released, closing this bug.


Note You need to log in before you can comment on or make changes to this bug.