Bug 1283944 - Template creation task after upgrade isn't marked as finished
Template creation task after upgrade isn't marked as finished
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: Setup.Engine (Show other bugs)
3.6.0
Unspecified Unspecified
unspecified Severity high (vote)
: ovirt-3.6.1
: 3.6.1.2
Assigned To: Eli Mesika
Petr Matyáš
infra
:
Depends On: 1286441 1295412
Blocks: RHEV3.6Upgrade
  Show dependency treegraph
 
Reported: 2015-11-20 06:13 EST by Petr Kubica
Modified: 2016-02-10 14:18 EST (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-13 09:39:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
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 06:13 EST, Petr Kubica
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 49424 master MERGED dbutils: Clean jobs when steps are cleaned Never
oVirt gerrit 49572 ovirt-engine-3.6 MERGED dbutils: Clean jobs when steps are cleaned Never
oVirt gerrit 49573 ovirt-engine-3.6.1 MERGED dbutils: Clean jobs when steps are cleaned Never

  None (edit)
Description Petr Kubica 2015-11-20 06:13:22 EST
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 01:30:29 EST
Oved, shouldn't upgrade be blocked if there are running tasks/command entities/compensation in the db ?
Comment 2 Oved Ourfali 2015-11-22 01:35:05 EST
It should.. For sure for tasks, and perhaps also for command entities. 

Didi?
Comment 3 Yedidyah Bar David 2015-11-22 02:43:53 EST
(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 03:29:30 EST
(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 08:01:28 EST
(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 03:08:51 EST
Please fill in whiteboard in accordance to http://etherpad.corp.redhat.com/whiteboard as well as severity.
Comment 7 Moti Asayag 2015-11-24 03:50:25 EST
(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 06:41:34 EST
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 08:21:34 EST
Moving to POST. This should be backported.
Comment 10 Petr Matyáš 2016-01-07 09:27:09 EST
Verified on 3.6.2-3
Comment 11 Sandro Bonazzola 2016-01-13 09:39:42 EST
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.