Bug 1399127

Summary: Attempt to list bundle versions in RHQ fails with the message "Failed to find defined bundles...."
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: Performance, DatabaseAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.12CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1399125    

Description bkramer 2016-11-28 10:35: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, RHQ 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):
RHQ 4.12

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 RHQ;
3. In the deploy.xml change the version number, create new bundle and upload it to the RHQ;
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 1 bkramer 2016-11-28 10:41:20 UTC
This has been reproduced using Oracle database.