
From Tal Nisan <tnisan@redhat.com>:
Tal Nisan has submitted this change and it was merged. Change subject: core: Block moving host to maintenance if it's running jobs ...................................................................... core: Block moving host to maintenance if it's running jobs When a host is running jobs (and specifically storage jobs) we should block moving it to maintenance until the jobs are completed. This patch adds support to get the operations running on a host and adds a validation when it's moved to maintenance. The following changes are made: 1. Added stored procedure (with tests) that returns steps related to a subject entity. 2. Add validation in MaintenanceNumberOfVdssCommand. Regardless of this change, the validation is racey as a job (or a task) could be started after the validation. Locks should be added in order to sync between the maintenance flow and the start of jobs on a host. As this issue existed always, it'll be handled in a separate change - this patch adds the validation. Change-Id: Ibfa5947a39844b22bacf28f873bc6842bcf15040 Bug-Url: https://bugzilla.redhat.com/1444982 Signed-off-by: Liron Aravot <laravot@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MaintenanceNumberOfVdssCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/EngineMessage.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StepDao.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StepDaoImpl.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StepDaoTest.java M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/frontend/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M packaging/dbscripts/job_sp.sql 12 files changed, 128 insertions(+), 1 deletion(-) Approvals: Jenkins CI: Passed CI tests Moti Asayag: Looks good to me, approved Liron Aravot: Verified -- To view, visit https://gerrit.ovirt.org/75955 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfa5947a39844b22bacf28f873bc6842bcf15040 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-4.1 Gerrit-Owner: Liron Aravot <laravot@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot <laravot@redhat.com> Gerrit-Reviewer: Moti Asayag <masayag@redhat.com> Gerrit-Reviewer: Tal Nisan <tnisan@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>