Bug 1064312

Summary: Pool VMs are being pulled from template view in a very inefficient way
Product: Red Hat Enterprise Virtualization Manager Reporter: Tomas Dosek <tdosek>
Component: ovirt-engineAssignee: Liran Zelkha <lzelkha>
Status: CLOSED ERRATA QA Contact: Tareq Alayan <talayan>
Severity: high Docs Contact:
Priority: urgent    
Version: 3.3.0CC: aberezin, acathrow, bazulay, emesika, iheim, lpeer, lzelkha, pstehlik, rhev-integ, Rhev-m-bugs, sbonazzo, talayan, tdosek, tpoitras, yeylon, yzaslavs
Target Milestone: ---Keywords: ZStream
Target Release: 3.4.0Flags: talayan: needinfo-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, an inefficient query caused virtual machine pools pulled from template view to take a long time. This resulted in the query taking longer than expected to display results. Now, an updated query has fixed the problem. As a result, virtual machine pools are displayed more quickly.
Story Points: ---
Clone Of: 1061185
: 1066392 (view as bug list) Environment:
Last Closed: 2014-06-09 15:03:58 UTC Type: ---
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:    
Bug Blocks: 1066392, 1078909, 1142926    

Comment 1 Tomas Dosek 2014-02-12 12:02:44 UTC
Same observation as with templates and events was found with pools. :(

SELECT * FROM (SELECT * FROM vm_pools_full_view WHERE ( vm_pool_id IN (SELECT vm_pools_full_view.vm_pool_id FROM  vm_pools_full_view  ))  ORDER BY vm_pool_name ASC ) as T1 OFFSET (1 -1) LIMIT 100

Comment 3 Liran Zelkha 2014-02-17 09:25:30 UTC
Hi Tomas,

I can't understand what is the bug - is it from the vm_pools table or is it audit log table?

Comment 4 Tomas Dosek 2014-02-17 09:29:26 UTC
Sorry for that I really should not have cloned the BZ from the previous one.

The inefficient query is:

SELECT * FROM (SELECT * FROM vm_pools_full_view WHERE ( vm_pool_id IN (SELECT vm_pools_full_view.vm_pool_id FROM  vm_pools_full_view  ))  ORDER BY vm_pool_name ASC ) as T1 OFFSET (1 -1) LIMIT 100

So that looks like vm_pools table/view.

Comment 5 Liran Zelkha 2014-02-18 07:09:21 UTC
Hi Tomas,

Gerrit patch released, and will be available for 3.3.z. 
Note that the fix is validated for api call - http://localhost:8080/ovirt-engine/api/vmpools, without any parameters. This is the scenario you are testing, right?

Comment 7 Sandro Bonazzola 2014-02-19 12:01:59 UTC
All patches merged.

Comment 8 Sandro Bonazzola 2014-02-19 12:05:01 UTC
Maybe one patch need to be pushed to 3.4, please check if we're missing something in 3.4, otherwise please move to modified.

Comment 9 sefi litmanovich 2014-03-10 16:59:26 UTC
Just to make sure, this bug is an upstream bug and not a z-stream right?

Comment 10 Liran Zelkha 2014-03-10 19:28:15 UTC
Yes. It has a duplicate for downstream (1066392)

Comment 11 Tareq Alayan 2014-03-18 12:34:48 UTC
is this merged to rhevm-3.4.0-0.5.master ?

Comment 12 Liran Zelkha 2014-03-18 12:43:23 UTC
These are the 3.4 tags I'm familiar with - which one do you mean?

ovirt-engine-3.4.0_beta1
ovirt-engine-3.4.0_beta2
ovirt-engine-3.4.0_beta3
ovirt-engine-3.4.0_rc1
ovirt-engine-3.4.0_rc2
ovirt-engine-3.4.0_rc3

Comment 13 Tareq Alayan 2014-03-18 13:01:56 UTC
I want to verify that this merged into the downstream 3.4  ovirt-engine-3.4.0_av3 



How can i verify that?

Comment 14 Tareq Alayan 2014-03-18 13:10:39 UTC
the fix is there and verified.

Comment 15 errata-xmlrpc 2014-06-09 15:03:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0506.html