ActiveMQ Classic 5.18.3 running in a fail-over configuration using SQL Server as backend datastore throws Primary Key violation error

29 views Asked by At

We have ActiveMQ Classic 5.18.3 running on two servers - S564 and S563. They are configured in a failover setup utilizing SQL Server as their back-end data store.

At random intervals, the following sequence of events occurs:

  1. S564 logs no longer able to keep the exclusive lock so giving up being a master
  2. S563 logs S563, becoming master with lease expiry ..... and got exclusive lock for the database.
  3. S564 logs Waiting as there are still 2 inflight and pending exchanges to complete, timeout in 293 seconds. Inflights per route: [route3 = 1, route2 = 1]
  4. S564 Keeps on logging Waiting as there are still 2 inflight and pending exchanges to complete... until the timeout is elapsed.
  5. Server S563 logs:
    Ignoring SQLException, java.io.IOException: Violation of PRIMARY KEY constraint 'PK__ACTIVEMQ__3214EC27C'. Cannot insert duplicate key in object 'dbo.ACTIVEMQ_MSGS'. The duplicate key value is (513793323).'
    

What is the reason for the SQL Server Primary Key Violation? How to resolve this?

0

There are 0 answers