Replication - current status and how to do failover

Bron Gondwana brong at fastmail.fm
Tue Apr 7 23:53:54 EDT 2020



On Sun, Apr 5, 2020, at 00:45, Olaf Frączyk wrote:
> Hello,
> 
> 1. Is currently master-master replication possible (maybe 3.2) Is it OK 
> to sync them two-way?

No, not really. It'll mostly be fine, but it doesn't (yet) handle folder create/rename/delete safely.

> If yes - how to set up such config?
> 
> 2. If master-master is impossible, is there any guide how to setup 
> failover from master to slave and possibly back? If split-brain happens 
> - is there an easy recovery from such state?

The way we do it at Fastmail is with an nginx proxy in front which knows which one is the master. For a clean shutdown, we shut down the master, then run sync_client -r -f with the log file (if anything was unreplicated) to make sure it's up to date, then shut down both and bring them up with the config pointing the replication the other way.

For a case where the master crashed hard, we switch the replica to be master by changing the config (with a restart again) then bring the old master back up and for sync_client everything again like above to switch back, so all new changes from the regular replica are back on the regular master. Then we bring up the regular master as master again, and run sync_client -A from there to replicate all remaining changes. That mostly works.

The plan in 3.4+ is to use the mailbox tombstone records to get the create/rename/delete to the same level of split-brain safety as the UIDs inside the mailbox have.

Cheers,

Bron.
-- 
 Bron Gondwana
 brong at fastmail.fm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20200408/7bbcb9b0/attachment.html>


More information about the Info-cyrus mailing list