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

Dan C dcodix at gmail.com
Wed Jun 4 12:08:10 BST 2014


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.4M erl_crash.dump
2.3M mnesia

(send some messages)

[root at ip-10-0-11-105 rabbitmq]# rabbitmqctl list_queues
Listing queues ...
ha_hello 10000
...done.
[root at ip-10-0-11-105 rabbitmq]# du -hs *
1.4M erl_crash.dump
4.6M mnesia
[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.4M erl_crash.dump
5.2M mnesia
[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.4M erl_crash.dump
2.3M mnesia

(restart seccond node)

[root at ip-10-0-11-105 rabbitmq]#  rabbitmqctl list_queues
Listing queues ...
ha_hello 0
...done.
[root at ip-10-0-11-105 rabbitmq]# du -hs *
1.4M erl_crash.dump
2.3M mnesia

----------------------------------------------------------------------------------

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.2M erl_crash.dump
2.3M mnesia

(send some messages)

[root at ip-10-0-10-175 rabbitmq]# rabbitmqctl list_queues
Listing queues ...
ha_hello 10000
...done.
[root at ip-10-0-10-175 rabbitmq]# du -hs *
1.2M erl_crash.dump
4.6M mnesia

(stop other node)

[root at ip-10-0-10-175 rabbitmq]# rabbitmqctl list_queues
Listing queues ...
ha_hello 10000
...done.
[root at ip-10-0-10-175 rabbitmq]# du -hs *
1.2M erl_crash.dump
4.6M mnesia

[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.2M erl_crash.dump
5.2M mnesia
[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_hello 0
...done.
[root at ip-10-0-10-175 rabbitmq]# du -hs *
1.2M erl_crash.dump
2.3M mnesia

----------------------------------------------------------------------------------

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140604/f9d95fb7/attachment.html>


More information about the rabbitmq-discuss mailing list