Bug 1283944

Summary: Template creation task after upgrade isn't marked as finished
Product: [oVirt] ovirt-engine Reporter: Petr Kubica <pkubica>
Component: Setup.EngineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: bugs, didi, ecohen, emesika, gklein, lsurette, lveyde, masayag, oourfali, pkubica, rbalakri, Rhev-m-bugs, rmartins, sbonazzo, stirabos, yeylon, ylavi
Target Milestone: ovirt-3.6.1Flags: rule-engine: ovirt-3.6.z+
ylavi: planning_ack+
masayag: devel_ack+
pstehlik: testing_ack+
Target Release: 3.6.1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-13 14:39:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1286441, 1295412    
Bug Blocks: 1285700    
Attachments:
Description Flags
engine logs none

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