Liran Zelkha has uploaded a new change for review.

Change subject: engine: Delete jobs that their steps have no async-tasks
......................................................................

engine: Delete jobs that their steps have no async-tasks

Sometimes async tasks complete but there were database errors
when closing the steps and jobs. This patch updates the periodic
job deletion to delete such jobs.

Change-Id: Iae00d615bff79f42d8428b867f1816d6e0aa9a72
Bug-Url: https://bugzilla.redhat.com/1040952
Signed-off-by: lzel...@redhat.com <lzel...@redhat.com>
---
M packaging/dbscripts/job_sp.sql
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/23170/1

diff --git a/packaging/dbscripts/job_sp.sql b/packaging/dbscripts/job_sp.sql
index 2f13bb3..4f0034c 100644
--- a/packaging/dbscripts/job_sp.sql
+++ b/packaging/dbscripts/job_sp.sql
@@ -484,6 +484,17 @@
     AND    status = 'FINISHED')
     OR    (end_time < v_failed_end_time
     AND    status IN ('FAILED', 'ABORTED', 'UNKNOWN'))));
+    DELETE FROM job
+    WHERE job_id IN
+        (SELECT job.job_id
+        FROM job,step
+        WHERE NOT job.is_external
+            AND job.job_id = step.job_id
+            AND step.step_id NOT IN
+                (SELECT async_tasks.step_id
+                FROM async_tasks, step
+                WHERE async_tasks.step_id = step.step_id));
+
 END; $procedure$
 LANGUAGE plpgsql;
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae00d615bff79f42d8428b867f1816d6e0aa9a72
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Liran Zelkha <lzel...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to