Bug 1594386
| Summary: | Unable to download largest chargeback report on production | ||
|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Satoe Imaishi <simaishi> |
| Component: | UI - OPS | Assignee: | Nick LaMuro <nlamuro> |
| Status: | CLOSED ERRATA | QA Contact: | Nandini Chandra <nachandr> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 5.9.0 | CC: | cpelland, dluong, hkataria, jprause, jrafanie, lavenel, mpovolny, nlamuro, obarenbo, pmukhedk, smallamp |
| Target Milestone: | GA | Keywords: | ZStream |
| Target Release: | 5.9.3 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | 5.9.3.3 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1590908 | Environment: | |
| Last Closed: | 2018-07-12 13:17:05 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | CFME Core | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1590908 | ||
| Bug Blocks: | |||
|
Comment 2
CFME Bot
2018-06-22 20:02:15 UTC
New commits detected on ManageIQ/manageiq-ui-classic/gaprindashvili: https://github.com/ManageIQ/manageiq-ui-classic/commit/68cf0da7c79f75f0e0e9f697a4f574c9e973465b commit 68cf0da7c79f75f0e0e9f697a4f574c9e973465b Author: Nick LaMuro <nicklamuro> AuthorDate: Thu Jun 14 17:43:10 2018 -0400 Commit: Nick LaMuro <nicklamuro> CommitDate: Thu Jun 14 17:43:10 2018 -0400 [GAP] Prefer valid_report_column? and contains_records? from MiqReportResult https://bugzilla.redhat.com/show_bug.cgi?id=1594386 Gaprindashvili Backport commit from: https://github.com/ManageIQ/manageiq-ui-classic/pull/4143 Original SHA: ff7ee24f4d50b38e96d5c0eccd8ca7398d6d310e Rest of original message below... * * * These are new methods added in: https://github.com/ManageIQ/manageiq/pull/17590 And are far more efficient for the use cases of ChargebackController and ReportController::SavedReports. app/controllers/chargeback_controller.rb | 5 +- app/controllers/report_controller/saved_reports.rb | 5 +- spec/controllers/chargeback_controller_spec.rb | 3 +- spec/controllers/miq_report_controller/trees_spec.rb | 16 +- spec/controllers/report_controller_spec.rb | 10 +- 5 files changed, 24 insertions(+), 15 deletions(-) https://github.com/ManageIQ/manageiq-ui-classic/commit/d3d0c445078c454b49bfb2fce744cab07c7579bb commit d3d0c445078c454b49bfb2fce744cab07c7579bb Author: Nick LaMuro <nicklamuro> AuthorDate: Thu Jun 14 18:34:52 2018 -0400 Commit: Nick LaMuro <nicklamuro> CommitDate: Thu Jun 14 18:34:52 2018 -0400 [GAP] Prefer `rr.report` over `rr.report_results` in SavedReportPaging mixin https://bugzilla.redhat.com/show_bug.cgi?id=1594386 Gaprindashvili Backport commit from: https://github.com/ManageIQ/manageiq-ui-classic/pull/4143 Original SHA: cb118f0c34462eca296e460d7b01cee29b51066c Rest of original message below... * * * This not only makes it so we are consistent between the main controller and the mixin, but this is also much faster to use this over `MiqReportResult#report_results` when there is a large `binary_blob` associated with the `MiqReportResult` record. app/controllers/mixins/saved_report_paging.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) https://github.com/ManageIQ/manageiq-ui-classic/commit/f9c1659e315a4aafc74d99052e7bacc625956e00 commit f9c1659e315a4aafc74d99052e7bacc625956e00 Author: Nick LaMuro <nicklamuro> AuthorDate: Thu Jun 14 17:52:53 2018 -0400 Commit: Nick LaMuro <nicklamuro> CommitDate: Thu Jun 14 17:52:53 2018 -0400 [GAP] Prefer `.exists?` over `.length?` in report button helpers https://bugzilla.redhat.com/show_bug.cgi?id=1594386 Gaprindashvili Backport commit from: https://github.com/ManageIQ/manageiq-ui-classic/pull/4143 Original SHA: b5260fd3dff13c9aa0cf7593518bfb557c07c420 Rest of original message below... * * * Calls to `.length` will fetch the entire record set or rows for the MiqReportResult, and in the current case of these button helpers, throw them all away without using any of the data fetched. In most cases, the `html_details` relation is probably what was is being used, so even caching these ahead of time is wasteful. By using `.exists?` as an alternative, we basically do a: SELECT 1 as one FROM miq_report_result_details WHERE "miq_report_result_details"."miq_report_result_id" = ? LIMIT 1 Which only returns a single digit from the database if it has at least one record and nothing if it doesn't. This will also be cached in a controller action by the ActiveRecord query cache, so it will also require zero queries the second time around. app/helpers/application_helper/button/report_download_choice.rb | 2 +- app/helpers/application_helper/button/report_only.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Verified that the code is present in 5.9.3.3. 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/RHSA-2018:2184 |