Bug 1399125 - Attempt to list bundle versions fails with the message "Failed to find defined bundles...."
Summary: Attempt to list bundle versions fails with the message "Failed to find define...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Performance, Database
Version: JON 3.3.2,JON 3.3.3,JON 3.3.4,JON 3.3.5,JON 3.3.6,JON 3.3.7
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ER01
: JON 3.3.8
Assignee: Josejulio Martínez
QA Contact: Filip Brychta
URL:
Whiteboard:
Depends On: 1399127
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-28 10:30 UTC by bkramer
Modified: 2020-01-17 16:15 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-16 18:45:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1416097 0 medium CLOSED Failed to delete the bundles when deleting a bundle with lot of configuration parameters and versions 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 2780521 0 None None None 2017-02-15 16:24:22 UTC
Red Hat Product Errata RHEA-2017:0285 0 normal SHIPPED_LIVE Red Hat JBoss Operations Network 3.3.8 bug fix update 2017-02-16 23:44:22 UTC

Internal Links: 1416097

Description bkramer 2016-11-28 10:30:45 UTC
Description of problem:
If bundle definition file (deploy.xml) contains big number of configuration parameters, after a certain number of uploaded bundle versions, JBoss ON will fail to list bundle versions and it will show message "Failed to find defined bundles. This occurred because the server is taking a long time to complete this request. Please be aware that the server may still be processing your request and it may complete shortly. You can check the server logs to see if any abnormal error occurred."


Version-Release number of selected component (if applicable):
JBoss ON 3.3.2 ... 3.3.7

How reproducible:
Always

Steps to Reproduce:
1. Create deploy.xml that contains a big number of configuration parameters (rhq:input-parameter);
2. Upload bundle to the JBoss ON;
3. In the deploy.xml change the version number, create new bundle and upload it to the JBoss ON;
4. Repeat step 3 for at least 20 -30 different bundle versions;
5. Try to deploy one of the bundle versions to the resource group;

Actual results:
Attempt to list bundle versions fails with the message: "Failed to find defined bundles. This occurred because the server is taking a long time to complete this request. Please be aware that the server may still be processing your request and it may complete shortly. You can check the server logs to see if any abnormal error occurred."


Expected results:
Attempt to list bundle versions does not fail and bundle versions are properly shown.

Additional info:
After hibernate DEBUG was enabled, it showed that the following query took very long time:

SELECT
    configurat0_.id                        AS id1_32_13_
  , configurat0_.config_format             AS config_f2_32_13_
  , configurat0_.description               AS descript3_32_13_
  , configurat0_.name                      AS name4_32_13_
  , propertyde1_.config_def_id             AS config_20_32_15_
  , propertyde1_.id                        AS id2_37_15_
  , propertyde1_.name                      AS formula2_15_
  , propertyde1_.id                        AS id2_37_0_
  , propertyde1_.activation_policy         AS activati3_37_0_
  , propertyde1_.config_def_id             AS config_20_37_0_
  , propertyde1_.description               AS descript4_37_0_
  , propertyde1_.display_name              AS display_5_37_0_
  , propertyde1_.name                      AS name6_37_0_
  , propertyde1_.order_index               AS order_in7_37_0_
  , propertyde1_.parent_map_definition_id  AS parent_21_37_0_
  , propertyde1_.group_id                  AS group_i22_37_0_
  , propertyde1_.READONLY                  AS READONLY8_37_0_
  , propertyde1_.required                  AS required9_37_0_
  , propertyde1_.SUMMARY                   AS SUMMARY10_37_0_
  , propertyde1_.version                   AS version11_37_0_
  , propertyde1_.DYNAMIC_TYPE              AS DYNAMIC12_37_0_
  , propertyde1_.DYNAMIC_KEY               AS DYNAMIC13_37_0_
  , propertyde1_.ALLOW_CUSTOM_ENUM_VALUE   AS ALLOW_C14_37_0_
  , propertyde1_.DEFAULT_VALUE             AS DEFAULT15_37_0_
  , propertyde1_.SIMPLE_TYPE               AS SIMPLE_16_37_0_
  , propertyde1_.units                     AS units17_37_0_
  , propertyde1_.MAX_ENTRIES               AS MAX_ENT18_37_0_
  , propertyde1_.parent_list_definition_id AS parent_23_37_0_
  , propertyde1_.MIN_ENTRIES               AS MIN_ENT19_37_0_
  , propertyde1_.dtype                     AS dtype1_37_0_
  , propertyde2_.id                        AS id2_37_1_
  , propertyde2_.activation_policy         AS activati3_37_1_
  , propertyde2_.config_def_id             AS config_20_37_1_
  , propertyde2_.description               AS descript4_37_1_
  , propertyde2_.display_name              AS display_5_37_1_
  , propertyde2_.name                      AS name6_37_1_
  , propertyde2_.order_index               AS order_in7_37_1_
  , propertyde2_.parent_map_definition_id  AS parent_21_37_1_
  , propertyde2_.group_id                  AS group_i22_37_1_
  , propertyde2_.READONLY                  AS READONLY8_37_1_
  , propertyde2_.required                  AS required9_37_1_
  , propertyde2_.SUMMARY                   AS SUMMARY10_37_1_
  , propertyde2_.version                   AS version11_37_1_
  , propertygr3_.ID                        AS ID1_38_2_
  , propertygr3_.DEFAULT_HIDDEN            AS DEFAULT_2_38_2_
  , propertygr3_.DESCRIPTION               AS DESCRIPT3_38_2_
  , propertygr3_.DISPLAY_NAME              AS DISPLAY_4_38_2_
  , propertygr3_.NAME                      AS NAME5_38_2_
  , propertygr3_.ORDER_INDEX               AS ORDER_IN6_38_2_
  , propertyde4_.id                        AS id2_37_3_
  , propertyde4_.activation_policy         AS activati3_37_3_
  , propertyde4_.config_def_id             AS config_20_37_3_
  , propertyde4_.description               AS descript4_37_3_
  , propertyde4_.display_name              AS display_5_37_3_
  , propertyde4_.name                      AS name6_37_3_
  , propertyde4_.order_index               AS order_in7_37_3_
  , propertyde4_.parent_map_definition_id  AS parent_21_37_3_
  , propertyde4_.group_id                  AS group_i22_37_3_
  , propertyde4_.READONLY                  AS READONLY8_37_3_
  , propertyde4_.required                  AS required9_37_3_
  , propertyde4_.SUMMARY                   AS SUMMARY10_37_3_
  , propertyde4_.version                   AS version11_37_3_
  , propertyde4_.MAX_ENTRIES               AS MAX_ENT18_37_3_
  , propertyde4_.parent_list_definition_id AS parent_23_37_3_
  , propertyde4_.MIN_ENTRIES               AS MIN_ENT19_37_3_
  , constraint5_.CONFIG_PROP_DEF_ID        AS CONFIG_P4_37_16_
  , constraint5_.ID                        AS ID2_36_16_
  , constraint5_.ID                        AS ID2_36_4_
  , constraint5_.DETAILS                   AS DETAILS3_36_4_
  , constraint5_.CONFIG_PROP_DEF_ID        AS CONFIG_P4_36_4_
  , constraint5_.dtype                     AS dtype1_36_4_
  , enumerated6_.PROPERTY_DEF_ID           AS PROPERTY5_37_17_
  , enumerated6_.ID                        AS ID1_41_17_
  , enumerated6_.order_index               AS order_in3_17_
  , enumerated6_.ID                        AS ID1_41_5_
  , enumerated6_.NAME                      AS NAME2_41_5_
  , enumerated6_.ORDER_INDEX               AS ORDER_IN3_41_5_
  , enumerated6_.PROPERTY_DEF_ID           AS PROPERTY5_41_5_
  , enumerated6_.STRING_VALUE              AS STRING_V4_41_5_
  , optionssou7_.PROPERTY_DEF_ID           AS PROPERTY7_37_18_
  , optionssou7_.id                        AS id1_34_18_
  , optionssou7_.id                        AS id1_34_6_
  , optionssou7_.expression                AS expressi2_34_6_
  , optionssou7_.EXPRESSION_SCOPE          AS EXPRESSI3_34_6_
  , optionssou7_.filter                    AS filter4_34_6_
  , optionssou7_.LINK_TO_TARGET            AS LINK_TO_5_34_6_
  , optionssou7_.PROPERTY_DEF_ID           AS PROPERTY7_34_6_
  , optionssou7_.TARGET_TYPE               AS TARGET_T6_34_6_
  , templates8_.config_def_id              AS config_d6_32_19_
  , templates8_.id                         AS id1_39_19_
  , templates8_.name                       AS formula3_19_
  , templates8_.id                         AS id1_39_7_
  , templates8_.config_id                  AS config_i5_39_7_
  , templates8_.config_def_id              AS config_d6_39_7_
  , templates8_.description                AS descript2_39_7_
  , templates8_.is_default                 AS is_defau3_39_7_
  , templates8_.name                       AS name4_39_7_
  , configurat9_.id                        AS id1_31_8_
  , configurat9_.CTIME                     AS CTIME2_31_8_
  , configurat9_.MTIME                     AS MTIME3_31_8_
  , configurat9_.NOTES                     AS NOTES4_31_8_
  , configurat9_.VERSION                   AS VERSION5_31_8_
  , properties10_.CONFIGURATION_ID         AS CONFIGUR7_31_20_
  , properties10_.ID                       AS ID2_35_20_
  , properties10_.NAME                     AS formula0_20_
  , properties10_.ID                       AS ID2_35_9_
  , properties10_.CONFIGURATION_ID         AS CONFIGUR7_35_9_
  , properties10_.ERROR_MESSAGE            AS ERROR_ME3_35_9_
  , properties10_.NAME                     AS NAME4_35_9_
  , properties10_.PARENT_LIST_ID           AS PARENT_L8_35_9_
  , properties10_.PARENT_MAP_ID            AS PARENT_M9_35_9_
  , properties10_.override                 AS override5_35_9_
  , properties10_.string_value             AS string_v6_35_9_
  , properties10_.DTYPE                    AS DTYPE1_35_9_
  , propertyli11_.ID                       AS ID2_35_10_
  , propertyli11_.CONFIGURATION_ID         AS CONFIGUR7_35_10_
  , propertyli11_.ERROR_MESSAGE            AS ERROR_ME3_35_10_
  , propertyli11_.NAME                     AS NAME4_35_10_
  , propertyli11_.PARENT_LIST_ID           AS PARENT_L8_35_10_
  , propertyli11_.PARENT_MAP_ID            AS PARENT_M9_35_10_
  , propertyma12_.ID                       AS ID2_35_11_
  , propertyma12_.CONFIGURATION_ID         AS CONFIGUR7_35_11_
  , propertyma12_.ERROR_MESSAGE            AS ERROR_ME3_35_11_
  , propertyma12_.NAME                     AS NAME4_35_11_
  , propertyma12_.PARENT_LIST_ID           AS PARENT_L8_35_11_
  , propertyma12_.PARENT_MAP_ID            AS PARENT_M9_35_11_
  , rawconfigu13_.CONFIG_ID                AS CONFIG_I7_31_21_
  , rawconfigu13_.ID                       AS ID1_94_21_
  , rawconfigu13_.ID                       AS ID1_94_12_
  , rawconfigu13_.CONFIG_ID                AS CONFIG_I7_94_12_
  , rawconfigu13_.CONTENTS                 AS CONTENTS2_94_12_
  , rawconfigu13_.CTIME                    AS CTIME3_94_12_
  , rawconfigu13_.MTIME                    AS MTIME4_94_12_
  , rawconfigu13_.PATH                     AS PATH5_94_12_
  , rawconfigu13_.SHA256                   AS SHA6_94_12_
FROM
    RHQ_CONFIG_DEF configurat0_
    LEFT OUTER JOIN
        RHQ_CONFIG_PROP_DEF propertyde1_
    ON
        configurat0_.id=propertyde1_.config_def_id
    LEFT OUTER JOIN
        RHQ_CONFIG_PROP_DEF propertyde2_
    ON
        propertyde1_.parent_map_definition_id=propertyde2_.id
    LEFT OUTER JOIN
        RHQ_CONFIG_PROP_GRP_DEF propertygr3_
    ON
        propertyde2_.group_id=propertygr3_.ID
    LEFT OUTER JOIN
        RHQ_CONFIG_PROP_DEF propertyde4_
    ON
        propertyde2_.id       =propertyde4_.parent_list_definition_id
        AND propertyde4_.dtype='list'
    LEFT OUTER JOIN
        RHQ_CONFIG_PROP_CONSTR constraint5_
    ON
        propertyde1_.id=constraint5_.CONFIG_PROP_DEF_ID
    LEFT OUTER JOIN
        RHQ_CONF_PROP_DEF_ENUM enumerated6_
    ON
        propertyde1_.id=enumerated6_.PROPERTY_DEF_ID
    LEFT OUTER JOIN
        RHQ_CONFIG_PD_OSRC optionssou7_
    ON
        propertyde1_.id=optionssou7_.PROPERTY_DEF_ID
    LEFT OUTER JOIN
        RHQ_CONFIG_TEMPLATE templates8_
    ON
        configurat0_.id=templates8_.config_def_id
    LEFT OUTER JOIN
        RHQ_CONFIG configurat9_
    ON
        templates8_.config_id=configurat9_.id
    LEFT OUTER JOIN
        RHQ_CONFIG_PROPERTY properties10_
    ON
        configurat9_.id=properties10_.CONFIGURATION_ID
    LEFT OUTER JOIN
        RHQ_CONFIG_PROPERTY propertyli11_
    ON
        properties10_.PARENT_LIST_ID=propertyli11_.ID
    LEFT OUTER JOIN
        RHQ_CONFIG_PROPERTY propertyma12_
    ON
        propertyli11_.PARENT_MAP_ID=propertyma12_.ID
    LEFT OUTER JOIN
        RHQ_RAW_CONFIG rawconfigu13_
    ON
        configurat9_.id=rawconfigu13_.CONFIG_ID
WHERE
    configurat0_.id IN (13285
                      , 18240
                      , 21187
                      , 21206
                      , 21226
                      , 21230
                      , 21724
                      , 21900
                      , 21905
                      , 22234
                      , 22236
                      , 22253
                      , 22254
                      , 22255
                      , 22271
                      , 22279)
ORDER BY
    propertyde1_.id ASC
  , templates8_.id ASC
;

Comment 2 bkramer 2016-11-28 10:46:20 UTC
This has been reproduced using Oracle database.

Comment 3 Michael Burman 2016-12-02 07:35:33 UTC
The query takes very long, because there's no indexes on some of those foreign keys, so the query does almost 10 full table sequential scans. That's going to take resources and time.

The listing should use LAZY querying of the properties, but for some reason they're loaded also (not needed for that page).

Comment 4 Michael Burman 2016-12-08 09:01:02 UTC
Forgot to write the actual solution to this issue, if someone wants to fix it while I'm on vacation.

In SelectBundleVersionStep class, one needs to fix the line 119 and do:

-        criteria.fetchConfigurationDefinition(true);
+        criteria.fetchConfigurationDefinition(false);

This will prevent fetching all the configurations at this point and instead only request the versions available. That's a fast operation.

Then, in the GetDeploymentConfigStep the selected version's configuration must be fetched. Now that it only targets a single version this should be quick enough.

+            BundleVersionCriteria criteria = new BundleVersionCriteria();
+            criteria.addFilterBundleId(wizard.getBundleId());
+            criteria.fetchConfigurationDefinition(true);
+            criteria.addFilterVersion(wizard.getBundleVersion().getVersion());

And then add some callbacks to actually render the data by requesting data from:
            GWTServiceLookup.getBundleService().findBundleVersionsByCriteria(criteria, //
                    new AsyncCallback<PageList<BundleVersion>>() {

That should do the trick and the feature works fine with larger amount of configuration options.

Comment 5 Josejulio Martínez 2016-12-15 17:27:05 UTC
This PR fixes the issue.
https://github.com/rhq-project/rhq/pull/280

Comment 6 Josejulio Martínez 2017-01-05 16:49:54 UTC
commit 73b6d32d0dd599788d7f3ad8bad4560f3e7a71a4
Merge: 31b1995 3f0314d
Author: Michael Burman <yak>
Date:   Thu Jan 5 15:56:27 2017 +0200

    Merge pull request #280 from josejulio/bugs/1399125
    
    Bug 1399125 - Don't load every version configuration, just the one needed.

commit 3f0314d0b9caf60e736686224932924d3c21c198
Author: Josejulio Martínez <jmartine>
Date:   Tue Dec 13 13:14:52 2016 -0600

    Bug 1399125 - Don't load every version configuration, just the one needed.

Comment 10 errata-xmlrpc 2017-02-16 18:45:48 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.

https://rhn.redhat.com/errata/RHEA-2017-0285.html


Note You need to log in before you can comment on or make changes to this bug.