Two bug fix patches

David Carter dpc22 at cam.ac.uk
Wed Sep 12 13:33:05 EDT 2007


Both at:

   http://www-uxsup.csx.cam.ac.uk/~dpc22/cyrus/patches/2.3cvs/

write_searchaddr.patch
======================

Spend some time this afternoon working out why the make_md5 databases on 
my shiny new Cyrus 2.3 mailstores were going nuts: "Cache Mismatch".

Eventually worked out that if a message is delivered by LMTP to several 
recipients, then the first recipient gets a correct ENVELOPE, but all the 
following recipients get an lcase()ed version. The reason is that 
append_fromstage() in 2.3 reuses the "struct body" calculated for the 
first recipient. Unfortunately there are some lcase() calls in the middle 
of message_write_cache() which overwrite fields in that structure.

The incorrect cyrus.cache entries are replicated as is by sync_client 
"UPLOAD PARSED", so master and replica are typically both incorrect.

I, of course, have to be different:

message_parsed_mapped_async.patch
=================================

Trivial patch, long blurb. Will not affect other Cyrus deployments.

content_lines and cache_version were not being passed correctly. Slightly 
embarrassed since I sent in a fix for the parent routine a few weeks back. 
Someone has a nice reconstruct to look forward too...

message_parsed_mapped_async() is used by "UPLOAD SIMPLE" in sync_server, 
which takes a plain text message and regenerates the cyrus.cache entry.

I use this for Cyrus 2.1.X <-> 2.3.X cross version replication. Everyone 
else will be using "UPLOAD PARSED" which passes cache entries verbatim 
alongside the message body. A couple of observations:

1) I think that it would make sense to change from "UPLOAD PARSED" to
    "UPLOAD SIMPLE" in the general case. I can't see much significant
    overhead in regenerating cache entries at the server end, and it
    is better than passing Cyrus version specific lumps of binary cache
    data over the wire. [UPLOAD SIMPLE also finesses the timestamp issues
    caused sync_message_fsync()'s deferred fflush()/fsync()/fclose()].

2) message_parsed_mapped_async() is an historical anomaly.

    It should really be replaced by message_parse_body() and
    message_create_record(). The existing parameters aren't quite right.

    message_parse_file() cheats a little by xmalloc()ing a struct
    body and passing it back as an opaque handle so that append_copy()
    and append_fromstage() can later call message_create_record().

-- 
David Carter                             Email: David.Carter at ucs.cam.ac.uk
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.


More information about the Cyrus-devel mailing list