You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Kyle Anderson (JIRA)" <ji...@apache.org> on 2009/07/29 01:58:33 UTC

[jira] Created: (AMQ-2334) getJMSRedelivered() incorrectly returns false after a MasterSlave failover

getJMSRedelivered() incorrectly returns false after a MasterSlave failover
--------------------------------------------------------------------------

                 Key: AMQ-2334
                 URL: https://issues.apache.org/activemq/browse/AMQ-2334
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.2.0
            Reporter: Kyle Anderson
         Attachments: SanRedeliver.java

Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
Normally if one transacted consumer receives a message, then disconnects without committing, the message is marked as getJMSRedelivered() as true.  If the broker fails and another takes over before the consumer disconnect, the message isn't marked as redelivered to the next consumer.

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


[jira] Updated: (AMQ-2334) getJMSRedelivered() incorrectly returns false after a MasterSlave failover

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

Bruce Snyder updated AMQ-2334:
------------------------------

    Fix Version/s: 5.5.0
                       (was: 5.4.1)

> getJMSRedelivered() incorrectly returns false after a MasterSlave failover
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2334
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2334
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>            Reporter: Kyle Anderson
>             Fix For: 5.5.0
>
>         Attachments: SanRedeliver.java
>
>   Original Estimate: 3 hours
>  Remaining Estimate: 3 hours
>
> Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
> Scenario:
> 1. Transacted consumer receives a message
> 2. Transacted consumer disconnects prior to committing
> 3. Transacted consumer #2 receives the same message.
> Normally consumer #2 sees that message as getJMSRedelivered() = true.  However, if the broker fails and another takes over from the data dir between step 1 and 3, the redelivery is set as false - even though a consumer has, in fact, seen the message before.  See attached unit test.

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


[jira] Updated: (AMQ-2334) getJMSRedelivered() incorrectly returns false after a MasterSlave failover

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

Kyle Anderson updated AMQ-2334:
-------------------------------

    Attachment: SanRedeliver.java

See attached unit test

> getJMSRedelivered() incorrectly returns false after a MasterSlave failover
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2334
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2334
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>            Reporter: Kyle Anderson
>         Attachments: SanRedeliver.java
>
>   Original Estimate: 3 hours
>  Remaining Estimate: 3 hours
>
> Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
> Normally if one transacted consumer receives a message, then disconnects without committing, the message is marked as getJMSRedelivered() as true.  If the broker fails and another takes over before the consumer disconnect, the message isn't marked as redelivered to the next consumer.

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


[jira] Commented: (AMQ-2334) getJMSRedelivered() incorrectly returns false after a MasterSlave failover

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53022#action_53022 ] 

Gary Tully commented on AMQ-2334:
---------------------------------

that seems like a reasonable (and smart) solution but it may make sense as part of a broker plugin and/or destination filter so that it can be easily enabled or disabled. If redelivery semantics are vital then it can be enabled through config etc.
>From what I can see, any other solution will require storing the message twice which would kill performance.

> getJMSRedelivered() incorrectly returns false after a MasterSlave failover
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2334
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2334
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>            Reporter: Kyle Anderson
>         Attachments: SanRedeliver.java
>
>   Original Estimate: 3 hours
>  Remaining Estimate: 3 hours
>
> Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
> Scenario:
> 1. Transacted consumer receives a message
> 2. Transacted consumer disconnects prior to committing
> 3. Transacted consumer #2 receives the same message.
> Normally consumer #2 sees that message as getJMSRedelivered() = true.  However, if the broker fails and another takes over from the data dir between step 1 and 3, the redelivery is set as false - even though a consumer has, in fact, seen the message before.  See attached unit test.

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


[jira] Updated: (AMQ-2334) getJMSRedelivered() incorrectly returns false after a MasterSlave failover

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

Kyle Anderson updated AMQ-2334:
-------------------------------

    Description: 
Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
Scenario:
1. Transacted consumer receives a message
2. Transacted consumer disconnects prior to committing
3. Transacted consumer #2 receives the same message.

Normally consumer #2 sees that message as getJMSRedelivered() = true.  However, if the broker fails and another takes over from the data dir between step 1 and 3, the redelivery is set as false - even though a consumer has, in fact, seen the message before.  See attached unit test.

  was:
Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
Normally if one transacted consumer receives a message, then disconnects without committing, the message is marked as getJMSRedelivered() as true.  If the broker fails and another takes over before the consumer disconnect, the message isn't marked as redelivered to the next consumer.


In my application, I'd prefer a message marked as redelivered if it wasn't to a re-delivered message that wasn't marked as such.

So a quick fix, I modified org.apache.activemq.broker.region.queue to increment the message count prior to persistent storage, then decremented immediately after on the version in memory:
message.incrementRedeliveryCounter();
store.addMessage(context, message);
message.setRedeliveryCounter(message.getRedeliveryCounter()-1);

Aside from marking all messages as redelivered upon recovery or a page in, any possible issues with this?  Any better solutions out there?

> getJMSRedelivered() incorrectly returns false after a MasterSlave failover
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2334
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2334
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>            Reporter: Kyle Anderson
>         Attachments: SanRedeliver.java
>
>   Original Estimate: 3 hours
>  Remaining Estimate: 3 hours
>
> Shared master/slave setup, described here http://activemq.apache.org/shared-file-system-master-slave.html
> Scenario:
> 1. Transacted consumer receives a message
> 2. Transacted consumer disconnects prior to committing
> 3. Transacted consumer #2 receives the same message.
> Normally consumer #2 sees that message as getJMSRedelivered() = true.  However, if the broker fails and another takes over from the data dir between step 1 and 3, the redelivery is set as false - even though a consumer has, in fact, seen the message before.  See attached unit test.

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