Sahina Bose has posted comments on this change. Change subject: engine: Support for gluster asynchronous tasks(WIP) ......................................................................
Patch Set 3: (4 inline comments) For zombie tasks -i.e tasks in engine but not in gluster, was planning to end job with status as unknown. Ideally, this situation should not arise if gluster can remember tasks for a configurable period of time. .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTaskManager.java Line 66: for (Guid taskId : glusterTasksList) { Line 67: //get status of task from vdsm Line 68: GlusterAsyncTask task = GlusterTaskStatusUtil.getTaskStatus(taskId); Line 69: //get step from db for the corresponding gluster task Line 70: List<Step> steps = DbFacade.getInstance().getStepDao().getStepsByExternalId(taskId); Will revisit this. Line 71: //update status in step table Line 72: for (Step step: steps) { Line 73: step.setDescription(getTaskMessage(step,task)); Line 74: if (hasTaskCompleted(task)) { Line 154: } Line 155: Line 156: private void initializeTasks() { Line 157: //get external tasks from DB where not completed. Line 158: //May not be required if we use gluster Tasks list from UP server for each cluster Gluster returns a list of running tasks for each cluster. The idea was to use this task list and update the corresponding step for each task. In this way, when the Task manager initializes, we get the list from gluster instead of db. Line 159: Line 160: initAndCleanupOrphanTasks(); Line 161: } .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RebalanceGlusterVolumeCommand.java Line 19: * This may be a long running operation and so the returned task id is used to update Line 20: * the status of the step and the corresponding job. Line 21: */ Line 22: @NonTransactiveCommandAttribute Line 23: public class RebalanceGlusterVolumeCommand extends GlusterAsyncCommandBase<GlusterVolumeRebalanceParameters> { yes. Will do Line 24: Line 25: private static final long serialVersionUID = 8747137699199502912L; Line 26: Line 27: public RebalanceGlusterVolumeCommand(GlusterVolumeRebalanceParameters params) { .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterAsyncTask.java Line 3: import java.io.Serializable; Line 4: Line 5: import org.ovirt.engine.core.compat.Guid; Line 6: Line 7: public class GlusterAsyncTask implements Serializable{ Similar, yes. ditto for TaskStatus and TaskType enums Line 8: Line 9: private static final long serialVersionUID = 5165089908032934194L; Line 10: Line 11: private Guid taskId; -- To view, visit http://gerrit.ovirt.org/11840 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a56785edef091bce74e2b7b0ba9a3314f1397f1 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Shireesh Anjal <san...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches