"reconstruct -k" is still broken: do not use.

David Carter dpc22 at cam.ac.uk
Wed Dec 26 14:31:32 EST 2007


On Sun, 23 Dec 2007, David Carter wrote:

> Rather more fundamental: "reconstruct -k" copies expunge.index records 
> verbatim, without making any effort to update offsets into cyrus.cache. 
> These offsets are used by both "cyr_expire -X" and "unexpunge".
>
> [...]
>
> I know how I plan to fix this problem: reconstruct needs to rebuild
> cyrus.index and expunge in parallel, rather like sync_combine_commit().
> However this will be a rewrite of reconstruct.c, not a one line fix.

Here is a replacement reconstruct:

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

reconstruct_read_index_record() is a bit of an embarrassment. It is just 
mailbox_read_index_record_from_mapped() without a mailbox, as start_offset 
and record size will be invalid if the cyrus.index file is toast.

We really need clean separation between routines which go digging around 
inside mmap()ed files (and inherently trust the data they see there), and 
the level up which works with struct mailbox and struct index_record 
objects. I suspect that this is where Bron's CRC32 stuff is heading.

A number of the support routines are derived from sync_commit.c: some 
scope for refactoring there.

-- 
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