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

Simon MacMullen simon at rabbitmq.com
Wed Jun 4 12:13:19 BST 2014


Please read: 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
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list