Bug 1283944 - Template creation task after upgrade isn't marked as finished
Summary: Template creation task after upgrade isn't marked as finished
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Engine
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-3.6.1
: 3.6.1.2
Assignee: Eli Mesika
QA Contact: Petr Matyáš
URL:
Whiteboard: infra
Depends On: 1286441 1295412
Blocks: RHEV3.6Upgrade
TreeView+ depends on / blocked
 
Reported: 2015-11-20 11:13 UTC by Petr Kubica
Modified: 2016-02-10 19:18 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-13 14:39:42 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-3.6.z+
ylavi: planning_ack+
masayag: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)
engine logs (825.25 KB, application/x-gzip)
2015-11-20 11:13 UTC, Petr Kubica
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 49424 0 master MERGED dbutils: Clean jobs when steps are cleaned Never
oVirt gerrit 49572 0 ovirt-engine-3.6 MERGED dbutils: Clean jobs when steps are cleaned Never
oVirt gerrit 49573 0 ovirt-engine-3.6.1 MERGED dbutils: Clean jobs when steps are cleaned Never

Description Petr Kubica 2015-11-20 11:13:22 UTC
Created attachment 1097104 [details]
engine logs

Description of problem:
Creating of template never marked as finished when it was completed during setup of engine. Template was successfully created and it can be used for creating new VM. Problem is only in marking task as completed.

Version-Release number of selected component (if applicable):
rhevm-3.6.0.3-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Have an engine with VM
2. Start creating template of VM and then stop ovirt-engine service
3. Run upgrade (engine-setup)
4. Wait for completing of the task.
5. After successfully completed setup, check the task in tasks panel (Task is never marked as completed (Finalizing)  

Actual results:
Task isn't marked as completed

Expected results:
Task should be marked as completed

Additional info:
Attached logs from engine

Comment 1 Moti Asayag 2015-11-22 06:30:29 UTC
Oved, shouldn't upgrade be blocked if there are running tasks/command entities/compensation in the db ?

Comment 2 Oved Ourfali 2015-11-22 06:35:05 UTC
It should.. For sure for tasks, and perhaps also for command entities. 

Didi?

Comment 3 Yedidyah Bar David 2015-11-22 07:43:53 UTC
(In reply to Oved Ourfali from comment #2)
> It should.. For sure for tasks, and perhaps also for command entities. 
> 
> Didi?

It seems we do, but only after clearing them first... I might be missing something. Simone, any idea?

Comment 4 Moti Asayag 2015-11-22 08:29:30 UTC
(In reply to Yedidyah Bar David from comment #3)
> (In reply to Oved Ourfali from comment #2)
> > It should.. For sure for tasks, and perhaps also for command entities. 
> > 
> > Didi?
> 
> It seems we do, but only after clearing them first... I might be missing
> something. Simone, any idea?

Perhaps in the reporter's scenario the tasks were cleared, however the job/steps refer to a task which is deleted, therefore it (the step which represents the task) cannot longer be terminated by the task monitoring.

Where is the logic for clearing open entities (tasks, commands, jobs - ?) before upgrade is applied ?

Comment 5 Yedidyah Bar David 2015-11-22 13:01:28 UTC
(In reply to Moti Asayag from comment #4)
> (In reply to Yedidyah Bar David from comment #3)
> > (In reply to Oved Ourfali from comment #2)
> > > It should.. For sure for tasks, and perhaps also for command entities. 
> > > 
> > > Didi?
> > 
> > It seems we do, but only after clearing them first... I might be missing
> > something. Simone, any idea?
> 
> Perhaps in the reporter's scenario the tasks were cleared, however the
> job/steps refer to a task which is deleted, therefore it (the step which
> represents the task) cannot longer be terminated by the task monitoring.
> 
> Where is the logic for clearing open entities (tasks, commands, jobs - ?)
> before upgrade is applied ?

packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/asynctasks.py

_validateZombies clears stuff

_validateAsyncTasks runs later and aborts if it finds stuff

I didn't carefully check what each does.

Comment 6 Yaniv Kaul 2015-11-24 08:08:51 UTC
Please fill in whiteboard in accordance to http://etherpad.corp.redhat.com/whiteboard as well as severity.

Comment 7 Moti Asayag 2015-11-24 08:50:25 UTC
(In reply to Oved Ourfali from comment #2)
> It should.. For sure for tasks,  

It seems that the tasks cleaning script clears all steps which has tasks.
We should either delete the entire jobs and not only the steps, or not clear any step/job and just update their statuses to 'Unknown' at setup time, and let the jobs cleanup manager (scheduled in engine) handle the clearing of them from the db.

The result of running the taskcleaner.sh should be no jobs/steps with 'STARTED' status.

> and perhaps also for command entities. 

The packaging/setup/dbutils/taskcleaner.sh script refers also to command-entities.

Comment 8 Red Hat Bugzilla Rules Engine 2015-11-24 11:41:34 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 9 Oved Ourfali 2015-12-02 13:21:34 UTC
Moving to POST. This should be backported.

Comment 10 Petr Matyáš 2016-01-07 14:27:09 UTC
Verified on 3.6.2-3

Comment 11 Sandro Bonazzola 2016-01-13 14:39:42 UTC
oVirt 3.6.1 has been released, closing current release


Note You need to log in before you can comment on or make changes to this bug.