Bug 1594387
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, jrafanie, lavenel, mpovolny, nachandr, nlamuro, obarenbo |
Target Milestone: | GA | Keywords: | ZStream |
Target Release: | 5.8.5 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | 5.8.5.0 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1590908 | Environment: | |
Last Closed: | 2018-09-26 18:36:47 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: | 1595269 |
Comment 2
CFME Bot
2018-06-22 19:41:31 UTC
New commits detected on ManageIQ/manageiq-ui-classic/fine: https://github.com/ManageIQ/manageiq-ui-classic/commit/64f8b1f07e8fe088778419d88145c0b7cf82fb62 commit 64f8b1f07e8fe088778419d88145c0b7cf82fb62 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 [FINE] Prefer valid_report_column? and contains_records? from MiqReportResult https://bugzilla.redhat.com/show_bug.cgi?id=1594387 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 | 9 +- 4 files changed, 12 insertions(+), 10 deletions(-) https://github.com/ManageIQ/manageiq-ui-classic/commit/adba577026db89dd78ef7f1ce3a7a1d45f4f63f5 commit adba577026db89dd78ef7f1ce3a7a1d45f4f63f5 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 [FINE] Prefer `.exists?` over `.length?` in report button helpers https://bugzilla.redhat.com/show_bug.cgi?id=1594387 Gaprindashvili Backport commit from: https://github.com/ManageIQ/manageiq-ui-classic/pull/4143 Original SHA: cb118f0c34462eca296e460d7b01cee29b51066c 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(-) https://github.com/ManageIQ/manageiq-ui-classic/commit/02fd904d1d10adfcdb5a06efa82f1110780edf8c commit 02fd904d1d10adfcdb5a06efa82f1110780edf8c 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 [FINE] Prefer `rr.report` over `rr.report_results` in SavedReportPaging mixin https://bugzilla.redhat.com/show_bug.cgi?id=1594387 Gaprindashvili Backport commit from: https://github.com/ManageIQ/manageiq-ui-classic/pull/4143 Original SHA: b5260fd3dff13c9aa0cf7593518bfb557c07c420 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/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Verified that the code is present in 5.8.5 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:2745 |