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
 br...@fastmail.fm

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Reply via email to