consistent backups without stopping cyrus?

Bron Gondwana brong at fastmail.fm
Sun Oct 7 19:42:39 EDT 2007


On Sun, Oct 07, 2007 at 06:26:36PM +0200, Martin Kraus wrote:
> Hi. Is there any plan to implement some finish-writes-and-hold-connections
> feature into cyrus to allow making of consistent online lvm snapshot possible?

I doubt it.  We get consistent enough[tm] backups from Cyrus (per
mailbox) as follows:

For each user (from the database of active users on the server, this
bit isn't done from Cyrus):

* seen, sub and sieve files are just backed up with no regard to
  timing, they're pretty separated from everything else...
* fetch the mailboxes list and ACLs.  For each mailbox:
  - lock the cyrus.header file and grab size, mtime and inode for the
    cyrus.header, cyrus.index and cyrus.expunge files
  - if all unchanged, skip
  - otherwise, fetch all three files again with cyrus.header locked
    (I'm wondering if I need to lock all three to guarantee
     consistency actually as I write this - but it's still going to
     be pretty close!)
  - for each of the two index files, read through and compare the
    UUIDs (soon to be GUIDs!) to our database of backed up message
    files. 
    # For each we don't have, fetch and store.
  - store the changed meta files into the backup.

This doesn't give you an exact "moment in time" of Cyrus state, but
it does restore to a workable state - you may not have marked one
message read after moving it or something like that, but it's pretty
good for a full recovery situation.  For anything less than total
system failure we have replication, delayed expunge and various RAID
etc going on.

Bron.


More information about the Info-cyrus mailing list