A couple of goodies
brong at fastmail.fm
Sun Jul 22 20:52:10 EDT 2007
On Thu, Jul 12, 2007 at 09:32:59PM +0100, David Carter wrote:
> Translate mailbox rename into filesystem rename() where possible.
> Falls back to mailbox_rename_copy() and mailbox_rename_cleanup().
> rename() isn't quite as safe as linking each message in turn and then
> removing the source mailbox: if the power fails after the rename() but
> before the mboxlist is updated then you have a missing mailbox. However:
Yeah, I'm not happy with this one until the safe shutdown stuff is in
place. We get a couple of bogus messages every time we do a failover,
which gives an idea of how busy our servers are! Not worth risking
doing that to a full mailbox!
> Companion to deleted expunge.
> Translate IMAP DELETE to a rename. The mailbox ends up in a nominated
> hierarchy (but the same partition) which is only visible to admin users.
> cyr_expire gains a -D option to match -X for delayed expunge.
> Benefits _substantially_ from fast_rename above.
Yeah, I can imagine. I'm hacking on this one now. One bug, one
"buglet". The bug is that you've hard coded the heirarchy name
(DELETED) into the target folder name sprintf even though it's a config
option everywhere else.
The buglet is that the renames aren't virtual-domain aware. I don't
know if you care that much given how rare these are - but it is possible
for two people to have exactly the same name folder in two different
The downside of how virtual domains are implemented means that the
mboxlist_findall would have to scan the entire folder tree in cyr_expire
rather than just "DELETED.*", but that's affordable I think.
Also, I prefer a different naming scheme for the deleted folders:
user.brong.Lists.Cyrus at fastmail.fm
deleted.brong.Lists.Cyrus.UNQID at fastmail.fm where UNQID is the folder
uniqueid of the folder that's being deleted. This allows our backup
system to find them much more easily. Again, it means more parsing in
cyr_expire (I suspect we're looking at a touch of the cyrus.header at
delete time and a stat at expire time) but it's more findable because
you can just query the mailboxes.db for deleted.$user.$folder.* and get
all the deleted folders that started with that name.
More information about the Cyrus-devel