TDB lockall necessary?

Gyepi Sam gyepi at praxis-sw.com
Sun Sep 7 20:36:45 CEST 2003


On Sun, Sep 07, 2003 at 04:07:49PM +0200, Matthias Andree wrote:
> Gyepi,
> 
> do we really need tdb_lockall? It's a massive performance hog, and
> tdb_store for instance appears to lock the key it is about to modify.

We need tdb_lockall to ensure that word and message counts are updated
as part of a transaction, to prevent concurrent bogofilters from updating or reading
incorrect counts.  I know it is a performance hog, and had initially
used file descriptor locking, but that did not work as expected (I
forget why, but recall that some tests failed.
cvs diff -r 1.1.2.2 -r 1.1.2.3 datastore_tdb.c). I was less
interested in speed than correctness at the time, so I switched to
tdb_lockall. You may want to review those revisions to be sure I did not
overlook something simple.

-Gyepi




More information about the bogofilter-dev mailing list