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: [email protected] <[email protected]>
---
M packaging/dbscripts/job_sp.sql
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/22474/1

diff --git a/packaging/dbscripts/job_sp.sql b/packaging/dbscripts/job_sp.sql
index 3aa675b..982f4f5 100644
--- a/packaging/dbscripts/job_sp.sql
+++ b/packaging/dbscripts/job_sp.sql
@@ -484,6 +484,18 @@
     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 job.is_external = false 
+               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/22474
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae00d615bff79f42d8428b867f1816d6e0aa9a72
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to