[rabbitmq-discuss] loss o messages on a cluster + durable queues + mirrored queues

Alexandre Bunn albunn at gmail.com
Wed Jan 9 18:57:54 GMT 2013


Good afternoon

I have a 2 nodes cluster with mirrored queues and I'm setting delivery_mode 
= 2 when I'm publishing messages to the cluster. I'm missing messages when 
I follow these steps below (for test issues).

Step 0 - Node1 (master) Node2 (slave)

# rabbitmqctl cluster_status
Cluster status of node 'rabbit at vid-mq01-mia' ...
[{nodes,[{disc,['rabbit at vid-mq01-mia','rabbit at vid-mq02-mia']}]},
 {running_nodes,['rabbit at vid-mq02-mia','rabbit at vid-mq01-mia']},
 {partitions,[]}]
...done.

# rabbitmqctl list_policies
Listing policies ...
/       ha-all  ^ha\\.  {"ha-mode":"all"}       0
...done.

## rabbitmqctl list_queues name durable policy
Listing queues ...
ha.teste        true    ha-all
...done.


- Step 1 - I write 2 messages, at ha.teste queue, 1 on each member of the 
cluster and the messages are mirrored as expected. Here there are two 
messages on each nodes (rabbitmqctl list_queues)

-- node1
# rabbitmqctl list_queues
Listing queues ...
ha.teste        2
...done.
# rabbitmqctl list_queues name pid slave_pids synchronised_slave_pids
Listing queues ...
ha.teste        <'rabbit at vid-mq01-mia'.3.253.0> 
[<'rabbit at vid-mq02-mia'.2.252.0>]       [<'rabbit at vid-mq02-mia'.2.252.0>]
...done.

-- node2
# rabbitmqctl list_queues
Listing queues ...
ha.teste        2
...done.
# rabbitmqctl list_queues name pid slave_pids synchronised_slave_pids
Listing queues ...
ha.teste        <'rabbit at vid-mq01-mia'.3.253.0> 
[<'rabbit at vid-mq02-mia'.2.252.0>]       [<'rabbit at vid-mq02-mia'.2.252.0>]
...done.

- Step 2 - I've stopped rabbitmq-server on node1 and node2 assume the 
master. Here there are the two messages on node2

-- Logs on node2
Mirrored-queue (queue 'ha.teste' in vhost '/'): Promoting slave 
<'rabbit at vid-mq02-mia'.2.252.0> to master

-- Status of the cluster on node2

# rabbitmqctl cluster_status
Cluster status of node 'rabbit at vid-mq02-mia' ...
[{nodes,[{disc,['rabbit at vid-mq01-mia','rabbit at vid-mq02-mia']}]},
 {running_nodes,['rabbit at vid-mq02-mia']},
 {partitions,[]}]
...done.

-- Status of the ha.teste queue on node2

# rabbitmqctl list_queues
Listing queues ...
ha.teste        2
...done.
# rabbitmqctl list_queues name pid slave_pids synchronised_slave_pids
Listing queues ...
ha.teste        <'rabbit at vid-mq02-mia'.2.252.0> []      []
...done.

- Step 3 - I start the rabbitmq-server on node1, node2 still master and 
node1 is running as slave. Here there are the two messages on node1 and 
node2

-- Log on node2
=INFO REPORT==== 9-Jan-2013::18:40:46 ===
rabbit on node 'rabbit at vid-mq01-mia' up

-- Status of the cluster on node1

# rabbitmqctl cluster_status
Cluster status of node 'rabbit at vid-mq01-mia' ...
[{nodes,[{disc,['rabbit at vid-mq01-mia','rabbit at vid-mq02-mia']}]},
 {running_nodes,['rabbit at vid-mq02-mia','rabbit at vid-mq01-mia']},
 {partitions,[]}]
...done.

-- Status of the ha.teste queue on node2
# rabbitmqctl list_queues
Listing queues ...
ha.teste        2
...done.

# rabbitmqctl list_queues name pid slave_pids synchronised_slave_pids
Listing queues ...
ha.teste        <'rabbit at vid-mq02-mia'.2.252.0> 
[<'rabbit at vid-mq01-mia'.1.253.0>]       []
...done.

- Step 4 - I've stopped rabbitmq-server on node2 and node1 assume the 
master but the messages disapeared

-- Logs on node1

=INFO REPORT==== 9-Jan-2013::18:43:42 ===
Mirrored-queue (queue 'ha.teste' in vhost '/'): Promoting slave 
<'rabbit at vid-mq01-mia'.1.253.0> to master

=INFO REPORT==== 9-Jan-2013::18:43:42 ===
rabbit on node 'rabbit at vid-mq02-mia' down

-- Cluster status on node1

# rabbitmqctl cluster_status
Cluster status of node 'rabbit at vid-mq01-mia' ...
[{nodes,[{disc,['rabbit at vid-mq01-mia','rabbit at vid-mq02-mia']}]},
 {running_nodes,['rabbit at vid-mq01-mia']},
 {partitions,[]}]
...done.

-- Status of the ha.teste queue on node1

# rabbitmqctl list_queues
Listing queues ...
ha.teste        0
...done.

# rabbitmqctl list_queues name pid slave_pids synchronised_slave_pids
Listing queues ...
ha.teste        <'rabbit at vid-mq01-mia'.1.253.0> []      []
...done.

Is it expected? What we have to do at server side or client side (python 
script) to make the messages really durable? All the servers are running 
centos6 x86_64 and rabbitmq 3.0.1-1.

Thanks

Alexandre Bunn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130109/f3841dd6/attachment.htm>


More information about the rabbitmq-discuss mailing list