You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Yves Sandfort (JIRA)" <ji...@apache.org> on 2008/06/03 10:36:00 UTC

[jira] Created: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
-------------------------------------------------------------------------------------------------------

                 Key: AMQ-1762
                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
             Project: ActiveMQ
          Issue Type: Bug
          Components: Message Store
    Affects Versions: 5.1.0
         Environment: Linux, with Postgres/EnterpriseDB
            Reporter: Yves Sandfort


As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.

Which gives you no clue about the real issue, so we searched for all kinds of issues around. 

However we figured out it was the ID column.

Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.

While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Posted by "Dziugas Baltrunas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61708#action_61708 ] 

Dziugas Baltrunas commented on AMQ-1762:
----------------------------------------

Was this issue fixed in any of 4.1.X or 5.X tree? For systems with some 200 msg / sec throughput, INTEGER reaches it's boundary in few months, so I believe this problem affects quite a lot of heavy users. Our workaround was to ALTER TABLE.

> Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1762
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>         Environment: Linux, with Postgres/EnterpriseDB
>            Reporter: Yves Sandfort
>             Fix For: NEEDS_REVIEWED
>
>         Attachments: PostgresqlJDBCAdapter.java.diff.txt
>
>
> As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.
> Which gives you no clue about the real issue, so we searched for all kinds of issues around. 
> However we figured out it was the ID column.
> Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.
> While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Posted by "Piotr Jagielski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48645#action_48645 ] 

Piotr Jagielski commented on AMQ-1762:
--------------------------------------

Same exception on Servicemix 3.2.1 with ActiveMQ 4.1 and Derby 10.4.1.3:

java.io.IOException: Failed to store acknowledgment for: atm on message ID:servicemix-64271-1228238657193-5:19:1:1:771 in container: java.sql.SQLException: The resulting value is outside the range for the data type INTEGER.
        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
        at org.apache.activemq.store.jdbc.JDBCTopicMessageStore.acknowledge(JDBCTopicMessageStore.java:54)
        at org.apache.activemq.store.journal.JournalTopicMessageStore$2.execute(JournalTopicMessageStore.java:170)
        at org.apache.activemq.store.journal.JournalMessageStore$3.execute(JournalMessageStore.java:293)
        at org.apache.activemq.util.TransactionTemplate.run(TransactionTemplate.java:44)
        at org.apache.activemq.store.journal.JournalMessageStore.checkpoint(JournalMessageStore.java:247)
        at org.apache.activemq.store.journal.JournalTopicMessageStore.checkpoint(JournalTopicMessageStore.java:162)
        at org.apache.activemq.store.journal.JournalPersistenceAdapter$5.call(JournalPersistenceAdapter.java:373)
        at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
        ... 3 more
Caused by:
java.sql.SQLException: The resulting value is outside the range for the data type INTEGER.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedResultSet.noStateChangeException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setLong(Unknown Source)
        at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doSetLastAck(DefaultJDBCAdapter.java:324)
        at org.apache.activemq.store.jdbc.JDBCTopicMessageStore.acknowledge(JDBCTopicMessageStore.java:51)
        ... 10 more

> Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1762
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>         Environment: Linux, with Postgres/EnterpriseDB
>            Reporter: Yves Sandfort
>             Fix For: 5.3.0
>
>         Attachments: PostgresqlJDBCAdapter.java.diff.txt
>
>
> As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.
> Which gives you no clue about the real issue, so we searched for all kinds of issues around. 
> However we figured out it was the ID column.
> Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.
> While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Posted by "Bruce Snyder (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Snyder updated AMQ-1762:
------------------------------

    Attachment: PostgresqlJDBCAdapter.java.diff.txt

Attaching a patch to add a small change to the ID column type for PostgreSQL from INTEGER to BIGINT. 

> Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1762
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>         Environment: Linux, with Postgres/EnterpriseDB
>            Reporter: Yves Sandfort
>             Fix For: 5.3.0
>
>         Attachments: PostgresqlJDBCAdapter.java.diff.txt
>
>
> As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.
> Which gives you no clue about the real issue, so we searched for all kinds of issues around. 
> However we figured out it was the ID column.
> Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.
> While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Posted by "Mario Lukica (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44413#action_44413 ] 

Mario Lukica commented on AMQ-1762:
-----------------------------------

I think the same problem exists in 4.1.2 with DerbyDB 10.1.1.0.

Here is the stack trace:
{noformat}
 WARN  [JournalMessageStore ] Message could not be added to long term store: Failed to broker message: ID:conn1-34774-1214943118671-4:888842:1:1:380 in container: SQL Exception: The resulting value is outside the range for the data type INTEGER.
java.io.IOException: Failed to broker message: ID:mgw1-34774-1214943118671-4:888842:1:1:380 in container: SQL Exception: The resulting value is outside the range for the data type INTEGER.
        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
        at org.apache.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessageStore.java:72)
        at org.apache.activemq.store.journal.JournalMessageStore$3.execute(JournalMessageStore.java:260)
        at org.apache.activemq.util.TransactionTemplate.run(TransactionTemplate.java:44)
        at org.apache.activemq.store.journal.JournalMessageStore.checkpoint(JournalMessageStore.java:247)
        at org.apache.activemq.store.journal.JournalMessageStore.checkpoint(JournalMessageStore.java:221)
        at org.apache.activemq.store.journal.JournalPersistenceAdapter$4.call(JournalPersistenceAdapter.java:356)
        at edu.emory.mathcs.backport.java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
        at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:135)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
        at java.lang.Thread.run(Thread.java:595)
Caused by: SQL Exception: The resulting value is outside the range for the data type INTEGER.
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedResultSet.noStateChangeException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setLong(Unknown Source)
        at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doAddMessage(DefaultJDBCAdapter.java:170)
        at org.apache.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessageStore.java:69)
        ... 10 more
{noformat}

Cause of the exception:
DefaultJDBCAdapter.doAddMessage:
    s.setLong(1,messageID.getBrokerSequenceId());

In this case error message explicitely points to INTEGER column range violation.

Message id ID:conn1-34774-1214943118671-4:888842:1:1:380 does not show brokerSequenceId, so I cannot verify it.

> Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1762
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>         Environment: Linux, with Postgres/EnterpriseDB
>            Reporter: Yves Sandfort
>
> As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.
> Which gives you no clue about the real issue, so we searched for all kinds of issues around. 
> However we figured out it was the ID column.
> Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.
> While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (AMQ-1762) Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac closed AMQ-1762.
------------------------------

         Assignee: Dejan Bosanac
    Fix Version/s: 5.3.0
                       (was: NEEDS_REVIEWED)
       Resolution: Duplicate

This has been fixed for 5.3.0, see https://issues.apache.org/activemq/browse/AMQ-2291 for more details

> Field Type for ID column on table activemq_msgs should be increased from integer to bigint for postgres
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1762
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1762
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>         Environment: Linux, with Postgres/EnterpriseDB
>            Reporter: Yves Sandfort
>            Assignee: Dejan Bosanac
>             Fix For: 5.3.0
>
>         Attachments: PostgresqlJDBCAdapter.java.diff.txt
>
>
> As the postgres size for an int is limited to: 2147483647 you can easily reach that number on a loaded ActiveMQ server within weeks. This is very hard to nail issue, as you get an exception like: Batch entry 0 INSERT INTO ACTIVEMQ_MSGS(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, MSG) VALUES (2152101302, ID:cnmacoll2.ms.de.cdip.net-2970-1212478745177-0:1397:1:1, 1, queue://CNMACollector_1000474_1000474, 0, <stream of 820 bytes>) was aborted.
> Which gives you no clue about the real issue, so we searched for all kinds of issues around. 
> However we figured out it was the ID column.
> Not sure if this happens on other plattforms too, but at least on all PostgreSQL versions.
> While checking this, someone should make sure that not the ID inside the java code will be the next issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.