Change in ovirt-engine[ovirt-engine-3.6]: core: prevent a race on add template version

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Fri Mar 25 07:35:19 UTC 2016


Piotr Kliczewski has submitted this change and it was merged.

Change subject: core: prevent a race on add template version
......................................................................


core: prevent a race on add template version

When adding a template version, we add the quartz job and then mapping
the ID of the base template to that job so we will be able to stop
on-going updates of VMs to the latest version of the template.

The problem is that we first "register" the quartz job and only then
add it to the map (because we need to ID of the produced job). But
when the job is being executed before the mapping is set, the VM
updates will not take place.

This patch suggests a simple fix - to add the template with null job
before registering the quartz job, and update the mapping after the
job is created.

We should rewrite the mechanism that cancels on-going updates
someday.

Change-Id: I955a655f2eaef8510e3884e7895b9ca6cd0a6349
Bug-Url: https://bugzilla.redhat.com/1294511
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M backend/manager/modules/bll/exclude-filters.xml
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
2 files changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Shahar Havivi: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Arik Hadas: Verified



-- 
To view, visit https://gerrit.ovirt.org/55219
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I955a655f2eaef8510e3884e7895b9ca6cd0a6349
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.6
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list