You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Helmut Janknecht (JIRA)" <ji...@apache.org> on 2008/07/04 08:52:04 UTC

[jira] Issue Comment Edited: (AMQ-1837) Lost messages after broker recovery

    [ https://issues.apache.org/activemq/browse/AMQ-1837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43925#action_43925 ] 

janknecht edited comment on AMQ-1837 at 7/3/08 11:51 PM:
----------------------------------------------------------------

One example log of a failure, here actually without a restart:

{noformat}
QUEUE-2 currently sent message #10000
QUEUE-8 currently received message #9000
QUEUE-4 currently sent message #10000
QUEUE-5 currently sent message #10000
QUEUE-9 currently sent message #10000
QUEUE-0 currently received message #10000
QUEUE-3 currently sent message #10000
QUEUE-4 currently received message #10000
QUEUE-2 currently received message #10000
Unexpected message from QUEUE-8! Expected: QUEUE-8: #9342, Received: QUEUE-8: #9343
{noformat}

It skipped one message #9342.
Browsing QUEUE-8 with JMX showed:

{noformat}
----------------------------------------------------------------------
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9344: QUEUE-8: #9344
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9345: QUEUE-8: #9345
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9346: QUEUE-8: #9346
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9347: QUEUE-8: #9347
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9348: QUEUE-8: #9348
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9350: QUEUE-8: #9350
...
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9474: QUEUE-8: #9474
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9475: QUEUE-8: #9475
----------------------------------------------------------------------
{noformat}

So QUEUE-8 does not contain this element.

Then I restarted the broker and now surprisingly the missing "QUEUE-8: #9342" appears, the "JMSRedelivered" is set to false.

So it seems that under heavy load in multi threaded scenarios persistent messages somtimes stuck.
With {{DeliveryMode.NON_PERSISTENT}} it seems to work.

      was (Author: janknecht):
    One example log of a failure, here actually without a restart:

{noformat}
QUEUE-2 currently sent message #10000
QUEUE-8 currently received message #9000
QUEUE-4 currently sent message #10000
QUEUE-5 currently sent message #10000
QUEUE-9 currently sent message #10000
QUEUE-0 currently received message #10000
QUEUE-3 currently sent message #10000
QUEUE-4 currently received message #10000
QUEUE-2 currently received message #10000
Unexpected message from QUEUE-8! Expected: QUEUE-8: #9342, Received: QUEUE-8: #9343
{noformat}

It skipped one message #9342.
Browsing QUEUE-8 with JMX showed:

{noformat}
----------------------------------------------------------------------
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9344: QUEUE-8: #9344
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9345: QUEUE-8: #9345
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9346: QUEUE-8: #9346
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9347: QUEUE-8: #9347
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9348: QUEUE-8: #9348
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9350: QUEUE-8: #9350
...
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9474: QUEUE-8: #9474
ID:dono-janknecht-4560-1215150766850-0:6:1:1:9475: QUEUE-8: #9475
----------------------------------------------------------------------
{noformat}

So QUEUE-8 does not contain this element.

Then I restarted the broker and now surprisingly the missing "QUEUE-8: #9342" appears, the "JMSRedelivered" is set to false.
  
> Lost messages after broker recovery
> -----------------------------------
>
>                 Key: AMQ-1837
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1837
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.1.0
>            Reporter: Jan Wiemer
>            Priority: Critical
>         Attachments: MultithreadedQueueTest2.zip, src.zip
>
>
> We experienced that some messages (send in persistent mode) were lost after the message broker was killed and restarted.
> The attached little test simulates the situation:
> There are 10 queues, 10 sender and 10 receiver threads each sending / receiving quite frequently to / from one queue for a quite long time.
> The receiver for each queue expects the messages exactly in the order the sender has send the messages.
> After restarting (killing) the broker the order of the received messages gets disturbed or messages get lost. 
> * Start the broker as configures by default in the distribution (only switch on JMX support). 
> * Start the main method of the attached class
> * Wait until some messages are received
> * kill or shutdown the broker
> * restart the broker
> * have a look at the output of the test class
> {code:title=Output}
> Exception in ReceiverThread: java.lang.RuntimeException: Received unexpected message! Expected: QUEUE-4: #3197, Received: QUEUE-4: #3267
> {code}
> {code:title=Broker Output}
> ...
> INFO  BrokerService                  - Using Persistence Adapter: AMQPersistenceAdapter(D:\sandbox\Experimental\Activemq\apache-activemq-5.2-SNAPSHOT\bin\..\data)
> INFO  AMQPersistenceAdapter          - AMQStore starting using directory: D:\sandbox\Experimental\Activemq\apache-activemq-5.2-SNAPSHOT\bin\..\data
> INFO  KahaStore                      - Kaha Store using data directory D:\sandbox\Experimental\Activemq\apache-activemq-5.2-SNAPSHOT\bin\..\data\kr-store\state
> INFO  AMQPersistenceAdapter          - Active data files: []
> WARN  AMQPersistenceAdapter          - The ReferenceStore is not valid - recovering ...
> INFO  KahaStore                      - Kaha Store successfully deleted data directory D:\sandbox\Experimental\Activemq\apache-activemq-5.2-SNAPSHOT\bin\..\data\kr-store\data
> INFO  AMQPersistenceAdapter          - Journal Recovery Started from: DataManager:(data-)
> INFO  KahaStore                      - Kaha Store using data directory D:\sandbox\Experimental\Activemq\apache-activemq-5.2-SNAPSHOT\bin\..\data\kr-store\data
> INFO  AMQPersistenceAdapter          - Recovered 198261 operations from redo log in 18.028 seconds.
> INFO  AMQPersistenceAdapter          - Finished recovering the ReferenceStore
> INFO  BrokerService                  - ActiveMQ 5.2-SNAPSHOT JMS Message Broker (localhost) is starting
> ...
> {code}

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