Oved Ourfali has uploaded a new change for review.

Change subject: core: task list in Webadmin - jobs disappear while still running
......................................................................

core: task list in Webadmin - jobs disappear while still running

Previous commit deleted jobs that had at least one step that doesn't
have an async task. Proper logic is to delete jobs that doesn't have
steps with async tasks.

Change-Id: I772ec5a6255351cd3145295c783385bf0a0c4de0
Bug-Url: https://bugzilla.redhat.com/1064227
Signed-off-by: Oved Ourfali <oourf...@redhat.com>
(cherry picked from commit 6e5452304692a7e1c201dbbe28b7d39c167f47d5)
---
M packaging/dbscripts/job_sp.sql
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/24375/1

diff --git a/packaging/dbscripts/job_sp.sql b/packaging/dbscripts/job_sp.sql
index df8c67f..5b5427d 100644
--- a/packaging/dbscripts/job_sp.sql
+++ b/packaging/dbscripts/job_sp.sql
@@ -484,16 +484,16 @@
     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));
+        (SELECT job_id
+         FROM job
+         WHERE NOT is_external
+               AND NOT EXISTS
+                (SELECT step.step_id
+                 FROM step, async_tasks
+                 WHERE step.job_id = job_id AND async_tasks.step_id = 
step.step_id));
 
 END; $procedure$
 LANGUAGE plpgsql;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I772ec5a6255351cd3145295c783385bf0a0c4de0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Oved Ourfali <oourf...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to