Syncing master and replica with different imap storage contents

Ivan Lezhnjov Jr. ivan.lezhnjov.jr at gmail.com
Wed Jul 13 11:19:20 EDT 2011


R stands for Replica, or real Replica
M stands for Master, or real Master
R turned M, means Replica host reconfigured to act as Master
M turned R, means Master host reconfigured to act as Replica

So, consider the following scenario.

We have two hosts M (host A) and R (host B). M received 4 messages and
synced up with R. R has 4 messages too.

Now, R goes down, after a while M receives 2 new messages and goes
down too. We fix R first and bring it back up as M. This R turned M
receives 3 new messages. We then fix M and bring it up as R.
Difference is that real M (host A) holds 2 new messages that real R
(host B) doesn't, while real Replica holds 3 new messages that real M
doesn't.

When tried out, M turned R (host A), when attempted to sync up, logged
the following:

Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: executed
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: accepted connection
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: cmdloop(): startup
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: login:
imapsite-master [10.10.0.205] cyrus PLAIN User logged in
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: Unlinking files in
mailbox user.zxy
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: IOERROR: failed to
parse /var/spool/imap/sync./7265/3b0d8ec2924b317b22b3864e587
8662d9e187fb4
Jul 13 12:13:41 imapsite-replica2 syncserver[7265]: IOERROR: failed to
append file user.zxy 15

However, the following workaround did the trick just fine:
[Replica aka MtR] % mv /var/lib/imap ~/lib-imap
[Replica aka MtR] % mv /var/spool/imap ~/spool-imap
[Replica aka MtR] % rsync -a --numeric-ids master:/var/spool/imap /var/spool/
[Replica aka MtR] % rsync -a --numeric-ids master:/var/lib/imap /var/lib/

After that sync worked just fine. The question is, though, how does
one interpret the error message logged and what can be done to bring
the two hosts in sync with each another in the scenario such as
described?


More information about the Info-cyrus mailing list