Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Intermittent] Observed "Error occurred while inserting destination queue" #546

Open
Drifftr opened this issue Jun 12, 2017 · 0 comments
Open

Comments

@Drifftr
Copy link
Contributor

Drifftr commented Jun 12, 2017

Observed an intermittent issue from the below scenario -
In a scenario where 5 queues with subscribers and 5 durable topics with subscribers were created below exception was thrown.
Checked the DB and observed that,

  • MB_QUEUE - Table did not have all the queues and the durable topics that were supposed to be created.
  • MB_QUEUE_MAPPING - Had entries for all queues and durable topic subscribers.

Issue - Only two queues were shown in console. Below exception occurred

TID: [-1234] [] [2015-09-24 12:01:14,655]  INFO {org.wso2.andes.kernel.AndesChannel} -  Channel created (ID: 11) {org.wso2.andes.kernel.AndesChannel}
TID: [-1234] [] [2015-09-24 12:01:14,688]  INFO {org.wso2.andes.kernel.AndesChannel} -  Channel created (ID: 12) {org.wso2.andes.kernel.AndesChannel}
TID: [] [] [2015-09-24 12:01:14,742] ERROR {org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl} -  Error occurred while inserting destination queue [carbon:ID5] to database  {org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl}
TID: [] [] [2015-09-24 12:01:14,744] ERROR {org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl} -  Error occurred while retrieving destination queue id for destination queue carbon:ID5 {org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl}
com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'const'. Cannot insert duplicate key in object 'dbo.MB_QUEUE_MAPPING'. The duplicate key value is (carbon:ID5).
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.createNewQueue(RDBMSMessageStoreImpl.java:1389)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.getQueueID(RDBMSMessageStoreImpl.java:1349)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.getCachedQueueID(RDBMSMessageStoreImpl.java:1313)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.addMetadataToBatch(RDBMSMessageStoreImpl.java:743)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.storeMessages(RDBMSMessageStoreImpl.java:451)
	at org.wso2.andes.store.FailureObservingMessageStore.storeMessages(FailureObservingMessageStore.java:148)
	at org.wso2.andes.kernel.MessagingEngine.messagesReceived(MessagingEngine.java:213)
	at org.wso2.andes.kernel.disruptor.inbound.MessageWriter.onEvent(MessageWriter.java:126)
	at org.wso2.andes.kernel.disruptor.ConcurrentBatchEventHandler.onEvent(ConcurrentBatchEventHandler.java:127)
	at org.wso2.andes.kernel.disruptor.ConcurrentBatchEventHandler.onEvent(ConcurrentBatchEventHandler.java:37)
	at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
TID: [] [] [2015-09-24 12:01:14,748]  WARN {org.wso2.andes.kernel.disruptor.inbound.MessageWriter} -  Unable to store messages, due to errors in message stores. opertation will be reattempted. messages count : 56 {org.wso2.andes.kernel.disruptor.inbound.MessageWriter}
TID: [] [] [2015-09-24 12:01:14,749] ERROR {org.wso2.andes.kernel.disruptor.LogExceptionHandler} -  [ Sequence: 315 ] Exception occurred while processing inbound events.Event type: MESSAGE_EVENT {org.wso2.andes.kernel.disruptor.LogExceptionHandler}
org.wso2.andes.store.AndesDataIntegrityViolationException: Error occurred while inserting messages to queue 
	at org.wso2.andes.store.rdbms.RDBMSStoreUtils.convertBySQLState(RDBMSStoreUtils.java:172)
	at org.wso2.andes.store.rdbms.RDBMSStoreUtils.convertSQLException(RDBMSStoreUtils.java:123)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.storeMessages(RDBMSMessageStoreImpl.java:465)
	at org.wso2.andes.store.FailureObservingMessageStore.storeMessages(FailureObservingMessageStore.java:148)
	at org.wso2.andes.kernel.MessagingEngine.messagesReceived(MessagingEngine.java:213)
	at org.wso2.andes.kernel.disruptor.inbound.MessageWriter.onEvent(MessageWriter.java:126)
	at org.wso2.andes.kernel.disruptor.ConcurrentBatchEventHandler.onEvent(ConcurrentBatchEventHandler.java:127)
	at org.wso2.andes.kernel.disruptor.ConcurrentBatchEventHandler.onEvent(ConcurrentBatchEventHandler.java:37)
	at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'const'. Cannot insert duplicate key in object 'dbo.MB_QUEUE_MAPPING'. The duplicate key value is (carbon:ID5).
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.createNewQueue(RDBMSMessageStoreImpl.java:1389)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.getQueueID(RDBMSMessageStoreImpl.java:1349)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.getCachedQueueID(RDBMSMessageStoreImpl.java:1313)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.addMetadataToBatch(RDBMSMessageStoreImpl.java:743)
	at org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl.storeMessages(RDBMSMessageStoreImpl.java:451)
	... 9 more
TID: [-1234] [] [2015-09-24 12:01:15,077]  INFO {org.wso2.andes.kernel.AndesChannel} -  Channel created (ID: 13) {org.wso2.andes.kernel.AndesChannel}


With reference to : https://wso2.org/jira/browse/MB-1356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant