[rabbitmq-discuss] replication related questions in cluster

Simon MacMullen simon at rabbitmq.com
Tue Apr 10 11:40:53 BST 2012

On 09/04/2012 7:24PM, Nithya Vijayakumar wrote:
> 1. When we do a publish to a rabbitmq node, when does the publish
> method return? Soon after that node got the data? or after replication
> happened? Is it possible to do synchronous publish with replication?
> We are trying to see if we can avoid the scenario that a node might go
> down soon after publish and before the data got replicated.
> Transactions seem costly and the async behavior of publisher confirms
> is not suiting us well.

Publish will return as soon as the message has gone out on the wire from 
the client's perspective. There's no guarantee the server has even seen 
it. This is to keep it asynchronous.

If you want a synchronous publish, wrap it in a transaction, or use the 
waitForConfirms methods in our clients. In recent RabbitMQ versions 
transactions are implemented in terms of confirms, so they are only more 
costly than confirms in that they force synchrony over the network.

> 2. When a node restarts, it cleans up the queues and joins the
> previously running node (logical master) and starts listening from
> then on. Even if the second node has the exact same copy of the data
> that was persisted as the current master, it still gets deleted.
> Wondering if there is an option to preserve current data in mnesia
> during restarts

The trouble is that it's hard for the restarted slave to know what's 
happened while it was down.

> or possibly synchronize the current set of data from
> the logical master.

Not at the moment. We hope to introduce this in a future version.

Cheers, Simon

More information about the rabbitmq-discuss mailing list