Bug 1028173 - Baseline calculation attempts to bind NaN, Overflow Exception for Oracle
Summary: Baseline calculation attempts to bind NaN, Overflow Exception for Oracle
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Core Server
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER07
: JON 3.2.0
Assignee: Stefan Negrea
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 1017474
Blocks: 1012435
TreeView+ depends on / blocked
 
Reported: 2013-11-07 20:26 UTC by Stefan Negrea
Modified: 2014-01-02 20:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1017474
Environment:
Last Closed: 2014-01-02 20:43:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Stefan Negrea 2013-11-07 20:26:25 UTC
+++ This bug was initially created as a clone of Bug #1017474 +++

See Bug 993513

This is RHQ 4.9, however.


01:05:17,366 ERROR [org.jboss.as.ejb3.invocation] (RHQScheduler_Worker-4) JBAS014134: EJB Invocation failed on component MeasurementBaselineManagerBean for method public abstract void org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal.calculateAutoBaselines(): javax.ejb.EJBException: java.lang.RuntimeException: Auto-calculation failure
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:191) [jboss-as-ejb3-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:237) [jboss-as-ejb3-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.never(CMTTxInterceptor.java:285) [jboss-as-ejb3-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]

...
	at org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal$$$view12.saveNewBaselines(Unknown Source) [rhq-server.jar:4.9.0]
	at org.rhq.enterprise.server.measurement.MeasurementBaselineManagerBean.calculateBaselines(MeasurementBaselineManagerBean.java:280) [rhq-server.jar:4.9.0]

...

Caused by: java.sql.BatchUpdateException: Internal Error: Overflow Exception trying to bind NaN
	at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10296) [ojdbc6.jar:11.2.0.2.0]
	at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:216) [ojdbc6.jar:11.2.0.2.0]
....

--- Additional comment from Elias Ross on 2013-11-07 10:00:33 EST ---

diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsBaselineCalculator.java b/modules/enterprise/server/server-metrics/src/main/java
index ef7d092..f132135 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsBaselineCalculator.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsBaselineCalculator.java
@@ -98,6 +98,9 @@ private MeasurementBaseline calculateBaseline(Integer schedule, long startTime,
                     }
                 }
             }
+            if (Double.isNaN(max) || Double.isNaN(min)) {
+                return null; // do not record this
+            }
 
             MeasurementBaseline baseline = new MeasurementBaseline();
             baseline.setMax(max);

^^ Not tested but maybe will work

--- Additional comment from Stefan Negrea on 2013-11-07 10:33:32 EST ---

Elias,

Your proposed fix would address something that is not possible. All aggregates have min, max and average; so adding that statement there only prevents cases where data was deleted maliciously from the storage nodes by users and not RHQ.


Do you have any other logs or data on how this is happening? Sample data or reproductions steps would greatly helps us fix the root cause of the issue.

Also, is this an upgrade from a prior version of RHQ or it is a fresh install?

--- Additional comment from Elias Ross on 2013-11-07 11:05:47 EST ---

Not possible?

The original bug was after an upgrade of a test cluster, so maybe some old data is a problem. I've recently seen the problem after my main server upgrade today, which was nearly a week ago.

I've had problems with my Cassandra cluster, where data has been coming up empty. Meaning, you query it and the expected data is not there. Could this cause an issue? I've seen 0 avg, NaN on min/max in the UI, for the metrics table. So there are NaNs someplace.

Even if my fix fixes something that is not possible, it fixes something I've seen on two servers. I've had to disable baseline calculation.

Comment 1 Stefan Negrea 2013-11-07 20:54:05 UTC
Elias, thanks for reporting the issue and a fix. There are two scenario that could lead to the problem you've reported; the data for a schedule is not completely persisted when the query for baselines runs or the data is not complete (delete or missing entries). I applied your proposed fix along with a comment. By returning null, the baseline calculation for the particular schedule will be postponed until the next data purge run.


release/jon3.2.x branch commit:

https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=release/jon3.2.x&id=acbc27a5372c55a950d79fe55c60c12e21bab16d

Comment 2 Simeon Pinder 2013-11-19 15:48:39 UTC
Moving to ON_QA as available for testing with new brew build.

Comment 3 Simeon Pinder 2013-11-22 05:14:05 UTC
Mass moving all of these from ER6 to target milestone ER07 since the ER6 build was bad and QE was halted for the same reason.


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