ctl_mboxlist dump/removal

Simon Beale simon at minos.org.uk
Fri Nov 8 11:10:42 EST 2013


> Hi,
>
> Quoting Simon Beale <simon at minos.org.uk>:
>
>> I'm trying to plan a promote/demote of a backend and a replica, to
>> effectively swap them over in 2.4.13 cluster.
>>
>> Given the hostnames are different, and we haven't got a magic dns record
>> to update, the list of mailboxes on the master needs to be changed. My
>> thinking of how to do this was to run this command on the master:
>>
>> ctl_mboxlist -d -x -p '${BACKEND}!default
>>
>> ... which will lose the current mailboxes from the master, then run
>>
>> ctl_mboxlist -m -a
>>
>> on the new machine to report and import the new destinations.
>>
>> However, running the dump command on the master gives:
>>
>> user.testmbox2  1 dc201kvmuser-12816!default testmbox2     lrswipkxtecda
>> fatal error: Internal error: assertion failed: cyrusdb_skiplist.c: 645:
>> db->lock_status == UNLOCKED
>>
>> It gives a similar response if I instead try running the same command
>> (after repairing the mailboxes list) on the backend.
>>
>> Am I doing something wrong with the use of ctl_mboxlist here?
>>
>> How do other people handle this switchover of backends/replicas for
>> disaster recovery purposes? In the absence of the '-x' options working,
>> I'm thinking it'll have to be a full master dump piped through sed and
>> reimported to replace references to the old server.
>>
>
> AFAIK "ctl_mboxlist -m -a" is sufficient. It will overide the old backend

Thanks, yes, in testing it certainly appears to do the right thing. I will
have to tidy up the mailboxes before running this in live, as I do appear
to have some mailbox inconsistencies between backend and replica.

For anyone following afterwards, one gotcha I feel worth pointing out is
that if you have a line in your cyrus.conf START section of:
mupdatepush   cmd="ctl_mboxlist -m"
... make sure you change that temporarily on the replica to:
mupdatepush   cmd="ctl_mboxlist -m -a"
... before you start cyrus, else you will likely immediately delete all
the mailboxes on the replica.

(Glad I found that one while still in test mode :)

I'm still curious as to why the "ctl_mboxlist -d -x" didn't work, but I do
at least have a way to do the migration now.

Simon



More information about the Info-cyrus mailing list