I have good news.  My improved directory hashing patch is ready.
It consists of two parts.  The patch file itself, 285 lines, should
be applied from the top-level source directory.  It's built against
cyrus-imapd-2.0.12.  It simply centralizes all directory hashing
into one function: dir_hash_c().  By default, this function uses
the old hashing scheme, based on the first letter of the user name.
When the compile-time symbol USE_DIR_FULL is defined, it uses the
new scheme that hashes all letters of the user name to provide an
even hash distribution.

The other part is a 500-line perl script called `rehash', which
converts the Cyrus directory structure between three hash schemes:
none, basic, and full.  `none' means no directory hashing at all.
`basic' is the current scheme, based on the first letter.  `full'
is the new hashing scheme.  This perl script replaces several of the
other perl scripts in the tools directory: dohash, mkimap, and
undohash, but not upgradesieve.  The name of the new hash scheme
must be specified as one of its command-line arguments.

To upgrade Cyrus to the new hash scheme, first apply the patch,
and then add this line to config.h:

        #define USE_DIR_FULL 1

Clearly, this should be done by configure, but I don't have the
tools to rebuild configure.  I hope that someone else can do this.
Next, recompile with `make'.

Then, stop sendmail and cyrus, and reinstall Cyrus with `make install'.
Convert to the new hash scheme with:

        .../rehash full

and then start sendmail and cyrus again.  The rehash script makes no
attempt to preserve the duplicate delivery database.  I don't know if
this can be done.

Where should I submit the patch?



-- 
-Gary Mills-    -Unix Support-    -U of M Academic Computing and Networking-

Reply via email to