Bug 1352825 - CommandEntity record isn't cleared for commands with callback that fails on validate() till the next engine restart.
Summary: CommandEntity record isn't cleared for commands with callback that fails on v...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Infra
Version: 4.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.2
: 4.0.2
Assignee: Liron Aravot
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-05 08:11 UTC by Arik
Modified: 2016-08-12 14:21 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1353604 (view as bug list)
Environment:
Last Closed: 2016-08-12 14:21:34 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
tnisan: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
engine_db_backup (1.20 MB, application/x-gzip)
2016-07-05 08:45 UTC, Israel Pinto
no flags Details
engine_log_1 (2.01 MB, application/x-gzip)
2016-07-05 08:46 UTC, Israel Pinto
no flags Details
engine_log_2 (102.62 KB, application/x-gzip)
2016-07-05 08:47 UTC, Israel Pinto
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 60346 0 master MERGED core: persist before validate() only when there is a parent with cb 2016-07-12 09:40:30 UTC
oVirt gerrit 60575 0 ovirt-engine-4.0 MERGED core: persist before validate() only when there is a parent with cb 2016-07-13 08:45:26 UTC
oVirt gerrit 60587 0 master MERGED core: CommandBase - don't update the command entity always 2016-07-12 12:49:57 UTC
oVirt gerrit 60625 0 ovirt-engine-4.0 MERGED core: CommandBase - don't update the command entity always 2016-07-13 08:45:41 UTC

Description Arik 2016-07-05 08:11:23 UTC
Description of problem:
Although the validation of add-vm fails the command remains in command_entities. After engine restart, the callback is executed and fails to end the add-vm command. Since we don't set retry to false, it will fail periodically, as shown by the audit logs in the log file.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create VM such that the validation will fail
2. 
3.

Actual results:
The command remains in FAILED state in command_entities
If the end-action of add-vm (that closes the disk operations) fails, an audit log will be periodically produced.

Expected results:
No periodic audit log should be produced and no callback should be executed

Additional info:

Comment 1 Israel Pinto 2016-07-05 08:45:03 UTC
Created attachment 1176302 [details]
engine_db_backup

Comment 2 Israel Pinto 2016-07-05 08:46:52 UTC
Created attachment 1176303 [details]
engine_log_1

Comment 3 Israel Pinto 2016-07-05 08:47:25 UTC
Created attachment 1176304 [details]
engine_log_2

Comment 4 Allon Mureinik 2016-07-05 16:41:08 UTC
Not sure if this is Storage's or Infra's, but definitely needs solving.

Liron - can you take a look please?

Comment 5 Liron Aravot 2016-07-07 14:31:01 UTC
Arik/Israel - we have few issues here:
1. endAction() failure.
2. orphaned CommandEntity record for commands with callbacks when validate() fails till the next engine restart.
3. endAction() is executed

the endAction() failure shouldn't happen and i couldn't reproduce it, Israel - can you check the exact scenario again and see if it reproduces? please also run the engine under DEBUG logging level and open a separate bug for that issue with the logs.

In this bug I'll handle #2 and clone this bug to a new bug for #3.

Comment 6 Arik 2016-07-10 06:26:08 UTC
Liron, previously this problem did not happen in the reported flow (AddVm) and therefore it is a regression.
(sure, it seems like a general problem in coco, but only now that it is used in this flow, AddVm is affected by this bug so I think we should treat that as a regression)

Comment 9 Raz Tamir 2016-07-26 15:24:27 UTC
Verified on ovirt-engine-4.0.2-0.1.rc.el7ev.noarch
Followed the steps:
1. Create VM based on template fails on validation
2. Delete the template
3. Restart the engine

That was provided by Liron


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