Bug 1534607
Summary: | Unable to use paging when searching for VMs available for specific user sorted by name | ||||||
---|---|---|---|---|---|---|---|
Product: | [oVirt] ovirt-engine | Reporter: | biakymet | ||||
Component: | RestAPI | Assignee: | Ori Liel <oliel> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Radim Hrazdil <rhrazdil> | ||||
Severity: | urgent | Docs Contact: | |||||
Priority: | urgent | ||||||
Version: | future | CC: | bugs, jniederm, lsvaty, lveyde, mperina | ||||
Target Milestone: | ovirt-4.2.2 | Flags: | rule-engine:
ovirt-4.2+
rule-engine: blocker+ |
||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | ovirt-engine-4.2.2.1 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2018-03-29 10:57:31 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: | |||||||
Bug Blocks: | 1480877, 1532186, 1541255 | ||||||
Attachments: |
|
Description
biakymet
2018-01-15 14:46:28 UTC
It applies to current master (commit 0427560272) as well. It reproduces even for admin@internal user. 'Filter: true' header has to be sent. It works like this (swap the search and max): /api/vms?search=SORTBY NAME ASC&max=2 Oh, but it doesn't work for 'filter: true', I see. My findings: * Order of search and max query params doesn't matter. The problem appears in both cases. * It appears even in 4.1 branch (commit 2591f4baa5) * Steps to reproduce 2 (always use user admin@internal): 1. make sure there are no vms in the engine 2. create a vm called "vm" 3. add a UserRole to it for admin@internal user 4. create a template 5. create a vm pool of 1 VM called "a-pool" 6. create a vm pool of 1 VM called "z-pool" 7. fire api request GET /api/vms?search=SORTBY NAME ASC&max=1 Filter: true Actual result: <vms/> * Possible cause: Method AbstractBackendCollectionResource#getBackendCollection(VdcQueryType, VdcQueryParametersBase, SearchType) executes two queries * GetAllVmsQuery that results all vms that a user has permission to. Results are trimmed to length of 'max' param. * SearchQuery that does filtering on name and applies limit and offset criteria. Result of the get request is a set intersection of results of these queries. In steps to reproduce 2 GetAllVmsQuery returns VM "vm" and SearchQuery may return a VM from a pool. Intersection of these results is empty. Urgent because current (and only) VM portal can't reliably show VMs due to this bug. Search engine is not usable with permissions and it would required complete redesign of it to allow that. That's why we decided to internally provide specialized query which is able to fetch VMs by name for specific user and provide paging support for it. Martin, we need this fix promptly. It blocks RHEV.TLV. When can we have it? (In reply to Yaniv Kaul from comment #7) > Martin, we need this fix promptly. It blocks RHEV.TLV. When can we have it? It should be merged till tomorrow, but marking this one as a blocker for 4.2.2 Verified by following steps in comment 4 and in the description for non-admin user. RHV 4.2.2 This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018. Since the problem described in this bug report should be resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report. |