[rabbitmq-discuss] |Spam| Disk mirrored queues deleting messages

Simon MacMullen simon at rabbitmq.com
Wed Jun 4 16:21:16 BST 2014


No, it's not.

You can wait for queues to synchronise due to consumers draining 
messages, or you can explicitly synchronise the queue after restarting 
the first node (manually or automatically).

In Mercurial (and thus eventually in 3.4.0 when it is released) RabbitMQ 
will by default shut down a mirrored queue when the master gracefully 
shuts down and there are only unsynchronised slaves to fail over to, 
since people do tend to trip over this.

Cheers, Simon

On 04/06/14 12:27, Dan C wrote:
> OK!
>
> Thanks for the fast answer!
> I was noticing that but I didn't know it "officially".
>
> Do you know if this behabiour is different in newer rabbitmq versions?
>
>
> On Wed, Jun 4, 2014 at 1:13 PM, Simon MacMullen <simon at rabbitmq.com
> <mailto:simon at rabbitmq.com>> wrote:
>
>     Please read: http://www.rabbitmq.com/ha.__html#unsynchronised-slaves
>     <http://www.rabbitmq.com/ha.html#unsynchronised-slaves>
>
>     (and also: there have been quite a few fixes to mirrored queues
>     since 3.1.5, you are strongly advised to upgrade)
>
>     Cheers, Simon
>
>
>     On 04/06/14 12:08, Dan C wrote:
>
>         Hi,
>
>         I'm doing some testing with rabbitmq 3.1.5 .
>         I don't know if I am doing something wrong or it is the normal
>         behabiour, but, when I setup a 2 nodes cluster, both to disk and
>         everytghing persistent, and withe the policy:
>         rabbitmqctl set_policy  ha-all "^ha_" '{"ha-mode":"all"}'
>
>         The system does something I don't understand.
>         If I create and send messages to a "ha_helloworld" queue those
>         messages
>         are sent to both nodes, and I can see how both nodes save those
>         messages
>         to disc as I can see how the "mnesia" directory grows.
>         If I stop one of the nodes the space of "mnesia" in that node
>         increase
>         (?¿), but when I start it again it will just decrease and lose
>         all messages.
>
>         Now, If I were to do the same with the second node, with the
>         first node
>         already restarted, the second node will just loose all messages
>         to, so I
>         will be losing all messages from the cluster.
>
>         I'll show the process at the end of the mail.
>
>         I don't know if this is the normal behabiour. I thougt that it
>         is, as
>         maybe it would be difficult to the server on the restarted node
>         to know
>         which messages has been already consumed while it was down. But
>         if it is
>         the case, why would anyone has a mirrored queue write to disk if all
>         data can be lost anyway?
>
>         I already tryed to find info about this fact but without success...
>
>         Here the process of both nodes:
>
>
>         ------------------------------__------------------------------__----------------------
>         NODE 1
>         [root at ip-10-0-11-105 rabbitmq]# pwd
>         /var/lib/rabbitmq
>         [root at ip-10-0-11-105 rabbitmq]# du -hs *
>         1.4Merl_crash.dump
>         2.3Mmnesia
>
>         (send some messages)
>
>         [root at ip-10-0-11-105 rabbitmq]# rabbitmqctl list_queues
>         Listing queues ...
>         ha_hello10000
>         ...done.
>         [root at ip-10-0-11-105 rabbitmq]# du -hs *
>         1.4Merl_crash.dump
>         4.6Mmnesia
>         [root at ip-10-0-11-105 rabbitmq]# /etc/init.d/rabbitmq-server stop
>         Stopping rabbitmq-server: rabbitmq-server.
>         [root at ip-10-0-11-105 rabbitmq]# du -hs *
>         1.4Merl_crash.dump
>         5.2Mmnesia
>         [root at ip-10-0-11-105 rabbitmq]# /etc/init.d/rabbitmq-server start
>         Starting rabbitmq-server: SUCCESS
>         rabbitmq-server.
>         [root at ip-10-0-11-105 rabbitmq]# du -hs *
>         1.4Merl_crash.dump
>         2.3Mmnesia
>
>         (restart seccond node)
>
>         [root at ip-10-0-11-105 rabbitmq]#  rabbitmqctl list_queues
>         Listing queues ...
>         ha_hello0
>         ...done.
>         [root at ip-10-0-11-105 rabbitmq]# du -hs *
>         1.4Merl_crash.dump
>         2.3Mmnesia
>
>
>         ------------------------------__------------------------------__----------------------
>
>         NODE 2
>
>         [root at ip-10-0-10-175 rabbitmq]# pwd
>         /var/lib/rabbitmq
>         [root at ip-10-0-10-175 rabbitmq]# du -hs *
>         1.2Merl_crash.dump
>         2.3Mmnesia
>
>         (send some messages)
>
>         [root at ip-10-0-10-175 rabbitmq]# rabbitmqctl list_queues
>         Listing queues ...
>         ha_hello10000
>         ...done.
>         [root at ip-10-0-10-175 rabbitmq]# du -hs *
>         1.2Merl_crash.dump
>         4.6Mmnesia
>
>         (stop other node)
>
>         [root at ip-10-0-10-175 rabbitmq]# rabbitmqctl list_queues
>         Listing queues ...
>         ha_hello10000
>         ...done.
>         [root at ip-10-0-10-175 rabbitmq]# du -hs *
>         1.2Merl_crash.dump
>         4.6Mmnesia
>
>         [root at ip-10-0-10-175 rabbitmq]# /etc/init.d/rabbitmq-server stop
>         Stopping rabbitmq-server: rabbitmq-server.
>         [root at ip-10-0-10-175 rabbitmq]# du -hs *
>         1.2Merl_crash.dump
>         5.2Mmnesia
>         [root at ip-10-0-10-175 rabbitmq]# /etc/init.d/rabbitmq-server start
>         Starting rabbitmq-server: SUCCESS
>         rabbitmq-server.
>         [root at ip-10-0-10-175 rabbitmq]# rabbitmqctl list_queues
>         Listing queues ...
>         ha_hello0
>         ...done.
>         [root at ip-10-0-10-175 rabbitmq]# du -hs *
>         1.2Merl_crash.dump
>         2.3Mmnesia
>
>         ------------------------------__------------------------------__----------------------
>
>         Thanks!
>
>
>
>
>         _________________________________________________
>         rabbitmq-discuss mailing list
>         rabbitmq-discuss at lists.__rabbitmq.com
>         <mailto:rabbitmq-discuss at lists.rabbitmq.com>
>         https://lists.rabbitmq.com/__cgi-bin/mailman/listinfo/__rabbitmq-discuss
>         <https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
>
>
>
>     --
>     Simon MacMullen
>     RabbitMQ, Pivotal
>
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list