[rabbitmq-discuss] RabbitMQ Highly Available Queues

Jerry Kuch jerryk at rbcon.com
Wed Jan 16 23:55:37 GMT 2013


On Wed, Jan 16, 2013 at 1:13 PM, Cao, Yican - 0551 - MITLL
<cao at ll.mit.edu>wrote:

Hi, Cao:

My question is what is going to happen to the consumer actually connected
> to master's URI when master node is dead. I can understand that consumers
> connected to original slave's URI won't notice any difference. Thanks.
>

Please see here for details:  http://www.rabbitmq.com/ha.html

You are quite correct in that, regardless of which cluster node a consumer
is connected to, the consuming is done from the master node of the mirror
set.  In the event of a master failure however, the following sequence of
events happens:

   - The eldest slave is promoted to become the new master
   - The slave considers *all* previous consumers to have been abruptly
   disconnected.  As a result all messages that have been delivered to clients
   but for which receipt of ACK is pending are requeued for redelivery.  This
   guards against cases where a delivery happened, but the ACK hadn't reached
   the master before its failure, or where the receipt of the ACK hadn't been
   successfully broadcast to the slaves prior to master failure.
   - Clients that were consuming from the mirrored queue (regardless of
   which node they had explicitly connected to) and that support the Consumer
   Cancellation Notification extension will be notified that their
   subscription to the mirrored queue has been cancelled.  They must then:
      - Re-consume from the queue, which will pick up the newly promoted
      master

The reason the CCN exists is to inform clients that the master was lost.

If the clients aren't told this, they may continue to ACK messages sent by
a now departed master, and they may be surprised by seeing messages a
second time (due to the requeuing in the second bullet point above).  If a
client happened to be connected directly to the crashed master, he'd of
course be disconnected and have to reconnect to a live node in the cluster.

So when you say "consumers connected to original slave's URI won't notice
any difference" that's not quite entirely true.  Further, the answer to
your question about "what is going to happen to the consumer actually
connected to master's URI when master node is dead" is that such a consumer
will be disconnected, have to reconnect to the cluster, and reconsume from
the queue.

Best regards,
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130116/9ce26681/attachment.htm>


More information about the rabbitmq-discuss mailing list