Description of problem: Commit below highly slows down performance of API requests with attributes https://github.com/ManageIQ/manageiq-api/commit/1845785bf7c3d7019df3c8002cff4c0cb9d33d36#diff-00bf332c6d31e69fa897ff19cd3e0bc5 E. g.: This request is used by ui-service api/services?expand=resources&limit=20&offset=0&attributes=picture%2Cpicture.image_href%2Cchargeback_report%2Cevm_owner.userid%2Cv_total_vms%2Cpower_state%2Call_service_children%2Ctags&filter[]=ancestry%3Dnull&sort_by=created_at&sort_options=&sort_order=desc Rbac is called for each attribute for each service 8 attributes * 20 services (default limit is 20) = 160 rbac calls Version-Release number of selected component (if applicable): manageiq gaprinashvili How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Even before the rbac was added, this report was also quite query intensive. It has to do access of vms from services/service templates. Looking into ways to reduce the number of queries. We've had a number of attempts here in the past, so it may be difficult to get much improvement Still looking into this
Still looking at this. Trying to find a way that each collection running through rbac does not cause multiple database queries.
FIXED. Verified on 5.11.0.8. Query: GET api/services?expand=resources&limit=20&offset=0&attributes=picture%2Cpicture.image_href%2Cchargeback_report%2Cevm_owner.userid%2Cv_total_vms%2Cpower_state%2Call_service_children%2Ctags&filter[]=ancestry%3Dnull&sort_by=created_at&sort_options=&sort_order=desc Of total 30 services, the request took about 4.32sec on 5.10.6 and 2.3sec on 5.11.0.8.
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. https://access.redhat.com/errata/RHBA-2019:4199