Bug 732571 - Admin Test page operation Snapshot Measurement Tables (snapshotMeasurementTables)fails against Oracle
Admin Test page operation Snapshot Measurement Tables (snapshotMeasurementTab...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
3.0.1
All All
high Severity high (vote)
: ---
: JON 3.1.1
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On:
Blocks: rhq41 830911
  Show dependency treegraph
 
Reported: 2011-08-22 20:15 EDT by Larry O'Leary
Modified: 2013-09-03 11:03 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 830911 (view as bug list)
Environment:
JON 2.4.1 Oracle 10i database
Last Closed: 2013-09-03 11:03:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Larry O'Leary 2011-08-22 20:15:17 EDT
Description of problem:
Invoking the snapshotMeasurementTables admin test operation returns an empty HTML table if the back-end database is Oracle.

The server log reveals the following error message:


Version-Release number of selected component (if applicable):
RHQ 3.0.1

How reproducible:
Always

Steps to Reproduce:
1. Using a Oracle database for the RHQ installation, navigate to http://localhost:7080/admin/test/control.jsp?mode=snapshotMeasurementTables
  
Actual results:
Near the top of the page:
Executed snapshotMeasurementTables: <table></table>

Expected results:
Near the top of the page:
Executed snapshotMeasurementTables: <table><tr><td>r00</td><td>113806</td></tr><tr><td>r01</td><td>0</td></tr><tr><td>r02</td><td>139520</td></tr><tr><td>r03</td><td>148381</td></tr><tr><td>r04</td><td>191861</td></tr><tr><td>r05</td><td>132352</td></tr><tr><td>r06</td><td>132355</td></tr><tr><td>r07</td><td>9223</td></tr><tr><td>r08</td><td>132347</td></tr><tr><td>r09</td><td>132353</td></tr><tr><td>r10</td><td>132357</td></tr><tr><td>r11</td><td>132350</td></tr><tr><td>r12</td><td>132349</td></tr><tr><td>r13</td><td>132355</td></tr><tr><td>r14</td><td>132353</td></tr><tr><td>oneHour</td><td>493763</td></tr><tr><td>sixHour</td><td>179715</td></tr><tr><td>oneDay</td><td>227058</td></tr><tr><td>trait</td><td>67390</td></tr><tr><td>bline</td><td>1680</td></tr><tr><td>oob</td><td>18</td></tr><tr><td>oob_temp</td><td>12</td></tr><tr><td>callkey</td><td>0</td></tr><tr><td>calldata</td><td>0</td></tr><tr><td>enabledMetricSchedules</td><td>3721</td></tr><tr><td>enabledTraitSchedules</td><td>1742</td></tr><tr><td>enabledCalltimeSchedules</td><td>0</td></tr></table>

Additional info:
This issue is due to the concatenation of the query string in org.rhq.enterprise.server.test.MeasurementTestBean.snapshotMeasurementTables(). Specifically, at line 229 we check to see if databaseType is Oracle and if it is, set querySuffix "from dual;". The problem with this is that on line 240 we put the snapshotQuery and querySuffix together without a space resulting in the end of the query becoming: "as enabledCalltimeSchedulesfrom dual;"

To fix this, we will need to change line 230 to:

            querySuffix = " from dual;";
Comment 1 bkramer 2011-08-26 06:58:43 EDT
We will have to make one more change in the snapshotQuery in order to run this sql properly on Oracle. Currently the string contains 

"...where ms.enabLed = true ..." 

and this works fine for Postgres but in Oracle it results in "ORA-01722:invalid number". This is because the ms.enabled (RHQ_MEASUREMENT_SCHED.ENABLED) column in Oracle is not a boolean value but a number, 1=TRUE and 0=FALSE.
Comment 2 Charles Crouch 2012-01-11 15:36:36 EST
Marking for inclusion in JON3.0.1, this should be an easy fix and should help with troubleshooting issues.
Comment 3 Charles Crouch 2012-02-14 18:45:26 EST
I think I spoke to soon on this issue. I'm pushing it out of 3.0.1 and into 3.1.0 for *consideration* as part of that release.
We really need to decide upon which, if any, of these admin/* pages we are going to "support" folks using. If this is one of those pages, it needs to be tested and verified by QE just like any other page in the UI
Comment 4 Larry O'Leary 2012-02-14 19:02:20 EST
This operation is supposed to provide the total metric count from the raw tables. This information is necessary for diagnostic and this bug was found during investigation of a database performance issue a user raised. The alternative is to provide the user with a very big query that they can execute against the database using the SQL test page. 

As such, I can not say this is required but if we decide not to do it we should remove this page/feature as it is currently broken for all supported databases.
Comment 6 Jay Shaughnessy 2012-06-11 12:08:00 EDT
Fixed upstream. Waiting for release branch to open.
Comment 7 Jay Shaughnessy 2012-07-17 15:31:19 EDT
Release/jon3.1.x commit: d5cd27a9c067315b55b8601bc5acf3ef6b34fa69

    Fixed this for Oracle. Also, change the JSP page to better display the
    results for this and some other options.
    
    Cherry-pick of master: b0e2a5a830ce54f0c902be9dc844fbe701182fdc
Comment 8 John Sanda 2012-08-02 14:52:08 EDT
JON 3.1.1 ER1 build is available. Moving to ON_QA.

https://brewweb.devel.redhat.com/buildinfo?buildID=226942
Comment 9 Filip Brychta 2012-08-07 06:56:53 EDT
Verified on 3.1.1.ER1
Comment 10 Heiko W. Rupp 2013-09-03 11:03:42 EDT
Bulk closing of old issues in VERIFIED state.

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