Sahina Bose has uploaded a new change for review.

Change subject: engine: Fixed view to return correct task
......................................................................

engine: Fixed view to return correct task

The task associated with volume is used to build
the activity column. In case of jobs that are started
but not yet associated with task id, the job status
will be 'STARTED'.

Fixed the stored proc to use this logic to pick
the correct task id.

Change-Id: Ifb25e2f59c4d5cfa063e498ada4e0091cc4ff53b
Signed-off-by: Sahina Bose <[email protected]>
---
M packaging/dbscripts/gluster_volumes_sp.sql
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/24364/1

diff --git a/packaging/dbscripts/gluster_volumes_sp.sql 
b/packaging/dbscripts/gluster_volumes_sp.sql
index 6db2cac..4c6ffca 100644
--- a/packaging/dbscripts/gluster_volumes_sp.sql
+++ b/packaging/dbscripts/gluster_volumes_sp.sql
@@ -297,10 +297,11 @@
     RETURNS SETOF gluster_volume_task_steps STABLE
        AS $procedure$
 BEGIN
-       RETURN QUERY SELECT *
-       FROM  gluster_volume_task_steps
-       WHERE volume_id = v_volume_id
-       ORDER BY job_start_time desc LIMIT 1;
+       RETURN QUERY SELECT gluster_volume_task_steps.*
+       FROM  gluster_volume_task_steps, gluster_volumes vol
+       WHERE volume_id = v_volume_id AND vol.id = volume_id 
+       AND job_status = 'STARTED' OR (job_status != 'STARTED' AND external_id 
= vol.task_id)
+       ORDER BY job_start_time desc LIMIT 1; 
 END; $procedure$
 LANGUAGE plpgsql;
 


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

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

Reply via email to