AMQ is recreating PK index in DB upon failover

Solution Verified - Updated -

Issue

  • I have configured following jdbcPersistenceAdapter
<persistenceAdapter>
            <jdbcPersistenceAdapter dataSource="#oracle-ds" useDatabaseLock="true" lockKeepAlivePeriod="2000" >
                <locker>
                    <lease-database-locker lockAcquireSleepInterval="30000"/>
                </locker>
            </jdbcPersistenceAdapter>
</persistenceAdapter>
  • As we can see in our tests One of the DB tables used by AMQ is ACTIVEMQ_ACKS. This table has a primary key constraint, which is implemented as unique index on the table. If an AMQ instance is master it will query the table. Oracle creates for the query an execution plan based on the index, which will be reused.
    If there is a failover of the master to another AMQ instance it looks like AMQ is dropping and re-creating the primary key constraint on ACTIVEMQ_ACKS,
    If one of the AMQ instances executes a select on ACTIVEMQ_ACKS again and Oracle decides to reuse the existing execution plan, based on the dropped index, an ORA-08103 error will be thrown.

  • Stack trace of error

2017-12-06 00:27:45,859 | WARN  | JDBC Failure: ORA-08103: object no longer exists
 | org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main
java.sql.SQLException: ORA-08103: object no longer exists

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
.
,
.
  • We think this happens with even a higher probability if the master bounces back and forth between the nodes

  • Thus our question is the following :
    Why does AMQ drop and re-create the primary key index? Is it a bug?

Environment

  • RedHat JBoss AMQ
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content