Bug 1095919 - Database deadlock errors when DiscoveryBossBean attempts to merge inventory report
Summary: Database deadlock errors when DiscoveryBossBean attempts to merge inventory r...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Database
Version: JON 3.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: JON 3.3.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-08 20:20 UTC by Larry O'Leary
Modified: 2018-12-06 16:27 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-09-30 23:17:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Log excerpt showing complete error and stack traces (34.62 KB, text/x-log)
2014-05-08 20:20 UTC, Larry O'Leary
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1093265 0 unspecified CLOSED Database deadlock errors when attempting to apply alert definitions updates 2021-02-22 00:41:40 UTC

Internal Links: 1093265

Description Larry O'Leary 2014-05-08 20:20:00 UTC
Created attachment 893790 [details]
Log excerpt showing complete error and stack traces

Description of problem:
Dead lock errors are reported resulting in database failures being reported.

From the stack trace (in the log excerpt) it appears these deadlocks occurred when an inventory merge was being done.

ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.LockAcquisitionException: Could not execute JDBC batch update
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:87)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
    ...
	at sun.proxy.$Proxy332.updateImplicitGroupMembership(Unknown Source)
	at org.rhq.enterprise.server.discovery.DiscoveryBossBean.addResourceToInventory(DiscoveryBossBean.java:944)
	at org.rhq.enterprise.server.discovery.DiscoveryBossBean.mergeResource(DiscoveryBossBean.java:711)
	at org.rhq.enterprise.server.discovery.DiscoveryBossBean.updatePreviouslyInventoriedResource(DiscoveryBossBean.java:899)
	at org.rhq.enterprise.server.discovery.DiscoveryBossBean.mergeResource(DiscoveryBossBean.java:708)
	at org.rhq.enterprise.server.discovery.DiscoveryBossBean.mergeInventoryReport(DiscoveryBossBean.java:178)
    ...
	at sun.proxy.$Proxy505.mergeInventoryReport(Unknown Source)
	at org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl.mergeInventoryReport(DiscoveryServerServiceImpl.java:75)
    ...
	at org.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(RemotePojoInvocationCommandService.java:184)
    ...
	at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProcessor.java:290)
	at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:184)
    ...
Caused by: java.sql.BatchUpdateException: ORA-00060: deadlock detected while waiting for resource

	at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10345)
	at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:230)
	at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:476)
	at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:774)
	at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247)
	... 189 more


Version-Release number of selected component (if applicable):
3.1.2.GA

Additional info:
This seems very similar to the deadlock issue raised in bug 1093265 but this appears to be driven by inventory sync/merge rather then user invoking a function of the UI.

Comment 1 Jay Shaughnessy 2014-05-16 16:50:10 UTC
Given the large changes in sync in JON 3.2.0 I'd say the recommendation here should be an upgrade.

Comment 6 Jay Shaughnessy 2014-09-30 21:40:35 UTC
I can tell you that the call chain in the log no longer exists.

We removed the umbrella Tx in mergeInventoryReport in commit  22053b3794a724a1fa997df07684ed14dd55b564 and further updated relevant Tx delimiters in commit b6e70d104756db633df7b4ff642c29e3fad81d2b.

I don't think this problem exists in the current release.  I recommend closing. Asking Larry to see if he concurs or otherwise can recommend some other course of action.

Comment 7 Larry O'Leary 2014-09-30 23:17:51 UTC
I concur. As we have had no reports of this issue past JBoss ON 3.1.2 and the inventory sync has been reworked, this issue seems like it should no longer occur.

If we find that this issue happens on 3.2 or -- when its released -- 3.3, then a new bug report should be opened providing steps to reproduce along with relevant logs.

Marking as CLOSED WORKSFORME.


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