What's happening in future branch - March 31

Bron Gondwana brong at fastmail.fm
Wed Mar 31 08:55:09 EDT 2010


On Thu, Mar 25, 2010 at 10:28:53PM +1100, Bron Gondwana wrote:
> Gosh, it's getting awfully close to my self imposed deadline of April
> isn't it - though I think I'll be pulling an Ubuntu and saying "I
> meant the end of April, honest".  Sysadmin stuff got in the way for
> rather longer than I intended.

Just pushed the latest "huge ball of mud" patch!  While it's still
probably buggy as all crap, I can now run up a local thunderbird
instance and save draft messages, move them around, delete them, copy
them between folders, set and remove flags.  All that good stuff.

I can also create and rename folders.  Not so sure that deleting folders
is 100% yet (it works, but it's not lock-safe)

This is with:
* combined index (expunged records retained in cyrus.index)
* cyrus.lock
* lazy-cache

And stacks of refactoring that I'm too tired to talk about right now, but
basically it's a lot more "object oriented" style - so you pass a record
struct to mailbox_rewrite_index_record() and it takes care of updating the
header fields automatically, as well as setting a dirty flag, bumping the
highestmodseq, etc.  Then when you've finished you just call
mailbox_commit() which will rewrite the header if anything has been
dirtied.  It simplifies code considerably, as you can see from the final
figures on the current diffstat.   Over 2000 lines of code deleted for a
gain in functionality!

 imap/annotate.c       |   58 +-
 imap/append.c         |  256 ++----
 imap/append.h         |    8 +-
 imap/arbitron.c       |   27 +-
 imap/chk_cyrus.c      |   11 +-
 imap/ctl_cyrusdb.c    |    9 +-
 imap/ctl_mboxlist.c   |   31 +-
 imap/cyr_expire.c     |   38 +-
 imap/cyr_virusscan.c  |   17 +-
 imap/cyrdump.c        |   14 +-
 imap/fud.c            |   47 +-
 imap/imap_err.et      |    3 +
 imap/imap_proxy.c     |    7 +-
 imap/imapd.c          |  266 +++---
 imap/imapd.h          |   12 +-
 imap/index.c          | 2498 +++++++++++++++++++------------------------------
 imap/index.h          |   25 +-
 imap/ipurge.c         |   31 +-
 imap/lmtpd.c          |   18 +-
 imap/mailbox.c        | 2345 +++++++++++++++++-----------------------------
 imap/mailbox.h        |  166 ++--
 imap/make_md5.c       |   20 +-
 imap/make_sha1.c      |   25 +-
 imap/mbdump.c         |   59 +-
 imap/mbdump.h         |    7 +-
 imap/mbexamine.c      |   52 +-
 imap/mboxlist.c       |  415 +++------
 imap/mboxlist.h       |   27 +-
 imap/mbpath.c         |    9 +-
 imap/mupdate.c        |    7 +-
 imap/nntpd.c          |   56 +-
 imap/pop3d.c          |   52 +-
 imap/quota.c          |   12 +-
 imap/reconstruct.c    |   63 +-
 imap/search_engines.c |   10 +-
 imap/smmapd.c         |   18 +-
 imap/squatter.c       |   33 +-
 imap/statuscache_db.c |    4 +-
 imap/sync_client.c    |  144 +---
 imap/sync_commit.c    |  424 ++--------
 imap/sync_server.c    |   72 +-
 imap/sync_support.c   |   24 +-
 imap/sync_support.h   |    5 +-
 imap/unexpunge.c      |   23 +-
 imap/user.c           |   31 +-
 imap/user.h           |    3 +
 lib/imapoptions       |    2 +-
 timsieved/parser.c    |   22 +-
 48 files changed, 2711 insertions(+), 4795 deletions(-)

I'll be testing this a lot more.  Still needs a bunch of work on replication
codepaths, testing of lmtp deliveries, etc.  And lots of just re-reading the
code I've written and reviewing it for correctness.

But I'm really glad to be at the point where it not only compiles but actually
does useful stuff again!  The giant changes are mostly in place, so from here
it should be small patches that can be individually tested!

The main format change I'm still planning to make it adding a "deleted" option
to the mailbox header - so when you delete a mailbox you can just leave the
files in place.  This makes deleting while selected viable within the locking
framework.

So the final process to FINISH with the mailbox will do the actual unlinking,
as it is the only one able to obtain an exclusive lock.

And that's the news from me!  Keep listening for more exciting updates :)

Bron.


More information about the Cyrus-devel mailing list