Yair Zaslavsky has uploaded a new change for review.

Change subject: core: fix storage pool ID association with tasks
......................................................................

core: fix storage pool ID association with tasks

The following patch fixes the association of storage
pool ID to its task after the task is created at VDSM.
Without this fix, the storage_pool_id column at async_tasks
table will have entries of EMPTY guids.

Bare in mind that when a place holder is created, the
async task creation info does not have the storage pool ID information.
IRS broker commands (i.e - CopyImage) create an async task creation info
object with storage pool ID, once the task is created at SPM and the task ID
is returned to engine.

Change-Id: I1b8f06e7c3b16504f76f6188f3d99fa5e80eedd4
Bug-Url: https://bugzilla.redhat.com/990524
Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com>
---
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AsyncTaskDAODbFacadeImpl.java
M packaging/dbscripts/async_tasks_sp.sql
2 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/32/17532/1

diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AsyncTaskDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AsyncTaskDAODbFacadeImpl.java
index 384e28f..6a29680 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AsyncTaskDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AsyncTaskDAODbFacadeImpl.java
@@ -175,6 +175,7 @@
         logNullParameters(task);
 
         AsyncTaskParameterSource parameterSource = 
getTaskParameterSource(task);
+        parameterSource.addValue("storage_pool_id", task.getStoragePoolId());
         getCallsHandler().executeModification("Updateasync_tasks", 
parameterSource);
     }
 
diff --git a/packaging/dbscripts/async_tasks_sp.sql 
b/packaging/dbscripts/async_tasks_sp.sql
index 8dd4a2a..a479bd5 100644
--- a/packaging/dbscripts/async_tasks_sp.sql
+++ b/packaging/dbscripts/async_tasks_sp.sql
@@ -36,7 +36,8 @@
        v_task_params_class varchar(256),
        v_step_id UUID,
        v_command_id UUID,
-       v_root_command_id UUID)
+       v_root_command_id UUID,
+        v_storage_pool_id UUID)
 RETURNS VOID
 
        --The [async_tasks] table doesn't have a timestamp column. Optimistic 
concurrency logic cannot be generated
@@ -53,7 +54,8 @@
           step_id = v_step_id,
           command_id = v_command_id,
           root_command_id = v_root_command_id,
-          vdsm_task_id = v_vdsm_task_id
+          vdsm_task_id = v_vdsm_task_id,
+          storage_pool_id = v_storage_pool_id
       WHERE task_id = v_task_id;
 END; $procedure$
 LANGUAGE plpgsql;
@@ -80,7 +82,7 @@
             PERFORM Insertasync_tasks(v_action_type, v_result, v_status, 
v_vdsm_task_id, v_task_id, v_action_parameters,
             v_action_params_class, v_task_parameters, v_task_params_class, 
v_step_id, v_command_id, v_root_command_id, v_started_at, v_storage_pool_id, 
v_async_task_type);
       ELSE
-            PERFORM Updateasync_tasks(v_action_type, v_result, v_status, 
v_vdsm_task_id, v_task_id, v_action_parameters,  v_action_params_class, 
v_task_parameters, v_task_params_class, v_step_id, v_command_id, 
v_root_command_id);
+            PERFORM Updateasync_tasks(v_action_type, v_result, v_status, 
v_vdsm_task_id, v_task_id, v_action_parameters,  v_action_params_class, 
v_task_parameters, v_task_params_class, v_step_id, v_command_id, 
v_root_command_id,v_storage_pool_id);
       END IF;
 END; $procedure$
 LANGUAGE plpgsql;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b8f06e7c3b16504f76f6188f3d99fa5e80eedd4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to