You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by danaR <ro...@yahoo.com> on 2013/11/01 09:31:57 UTC

Master/Slave failover behaviour

I have a question about the default behavior of ActiveMQ 5.8.0 in a
master/slave configuration (JDBC master/slave). 

We have a simple test of sending/receiving persistent messages, with
acknowledgement mode AUTO_ACKNOWLEDGE.

During the test we force a failover (we stop the current broker, so the
slave will become master). 

The problem (at least for us it's a problem) is that when the client fails
over to the new master broker, it receives duplicate messages. 
In the logs, we get this warning  "Ignoring ack received before dispatch;
result of failover with an outstanding ack. Acked messages will be replayed
if present on this broker."

So I'm guessing that this is the normal behavior and the client should be
the one that filters out the duplicates?

Can anyone confirm that this is the expected behavior?
And also, is there a configuration that could prevent this from happening?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-failover-behaviour-tp4673622.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave failover behaviour

Posted by danaR <ro...@yahoo.com>.
Yes, only one master/slave pair. 

We see that the consumer reconnects to the new promoted master. 

The problem is that the consumer sends an ack for messages that it received
from the other broker. The new broker says/ Ignoring ack received before
dispatch; result of failover with an outstanding ack. Acked messages will be
replayed if present on this broker./

So I guess the duplication of messages is implied. 

We were wondering if there is any configuration that would avoid this.




--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-failover-behaviour-tp4673622p4673638.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave failover behaviour

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, failover, should "wait" to reconnect to the promoted master.

You have only master/slave (no network of brokers), right ?

Regards
JB

On 11/01/2013 10:48 AM, danaR wrote:
> Hi,
> Thank you for the reply.
> Yes, we are using a URI like this:
> failover:(tcp://192.168.0.195:61616,tcp://192.168.0.196:61616)?initialReconnectDelay=100&trackMessages=true
>
> Still, I didn't understand your answer.
> Should using failover have taken care of our problem (the duplicate messages
> that we receive)?
> Or is it normal that the client receives duplicates when it fails over to
> the other broker (given the warning that we saw in the logs) ?
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-failover-behaviour-tp4673622p4673626.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Master/Slave failover behaviour

Posted by danaR <ro...@yahoo.com>.
Hi,
Thank you for the reply.
Yes, we are using a URI like this: 
failover:(tcp://192.168.0.195:61616,tcp://192.168.0.196:61616)?initialReconnectDelay=100&trackMessages=true

Still, I didn't understand your answer. 
Should using failover have taken care of our problem (the duplicate messages
that we receive)?
Or is it normal that the client receives duplicates when it fails over to
the other broker (given the warning that we saw in the logs) ? 




--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-failover-behaviour-tp4673622p4673626.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave failover behaviour

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I guess that you use failover: URI on the client connection factory ?

Anyway, the client "knows" that the master failed. But the failover:* 
URI should do the trick.

Regards
JB

On 11/01/2013 09:31 AM, danaR wrote:
> I have a question about the default behavior of ActiveMQ 5.8.0 in a
> master/slave configuration (JDBC master/slave).
>
> We have a simple test of sending/receiving persistent messages, with
> acknowledgement mode AUTO_ACKNOWLEDGE.
>
> During the test we force a failover (we stop the current broker, so the
> slave will become master).
>
> The problem (at least for us it's a problem) is that when the client fails
> over to the new master broker, it receives duplicate messages.
> In the logs, we get this warning  "Ignoring ack received before dispatch;
> result of failover with an outstanding ack. Acked messages will be replayed
> if present on this broker."
>
> So I'm guessing that this is the normal behavior and the client should be
> the one that filters out the duplicates?
>
> Can anyone confirm that this is the expected behavior?
> And also, is there a configuration that could prevent this from happening?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-failover-behaviour-tp4673622.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com