cyrus.expunge/cyrus.cache mistmatch on replica

Bron Gondwana brong at fastmail.fm
Mon Sep 24 09:01:20 EDT 2007


On Mon, 24 Sep 2007 08:53:14 +0100 (BST), "David Carter" <dpc22 at cam.ac.uk> said:
> On Mon, 24 Sep 2007, Bron Gondwana wrote:
> 
> > Any reason to actually keep them though?  It's not as if unexpunge is 
> > common enough to be worth optimising, and they're all auto-generated 
> > content that we can recreate from the message if needed.
> 
> My original motivation was user access to expunged messages and deleted 
> mailboxes. But Cyrus 2.3, doesn't do this, so you are quite correct.
> 
> Not having to rewrite the entire cyrus.cache file on every expunge is a 
> fairly substantial performance boost. We can keep this benefit by leaving 
> unreferenced junk in the cache file and then garbage collecting (rewrite 
> on expunge and/or cyr_expire) when the file reaches some threshold.

The attached fix doesn't do any optimisation yet, just zeros the cache offset
for cyrus.expunge members and re-build the cache entries on unexpunge.

Actually, the bulk of the work really is unexpunged.  I refactored a bit so
it counts what it creates rather than keeping offsets.  There is SO MUCH
COPIED CODE that I'd much rather make the interfaces in mailbox.c and
message.c flexible enough that everyone uses them.  In particular, I'd
like to see no direct bit manipulation stuff going on outside those files.
A bit of abstraction would be nice.

Oh, and I added an option to not fiddle the UIDVALIDITY for those of us
who don't mind doing the dirty under the hood sometimes.  It will make
it possible to use unexpunge rather than our current expedient of "delete
the cyrus.expunge file and run reconstruct"

Anyway - patch.  It compiles.  No promises past that!

Bron.
-- 
  Bron Gondwana
  brong at fastmail.fm

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cyrus-expungedcache-2.3.9.diff
Url: http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20070924/3dbe840a/attachment-0001.ksh 


More information about the Cyrus-devel mailing list