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:
Seems as though iterating over the disks in the endAction should be sorted somehow.
verified on ovirt-engine-3.5.0-0.0.master.20140804172041.git23b558e.el6.noarch
RHEV-M 3.5.0 has been released, closing this bug.