DB differences [ was: ... bogotune.c ... ]

David Relson relson at osagesoftware.com
Tue Jun 28 01:40:37 CEST 2005


On Mon, 27 Jun 2005 17:28:48 +0200
Matthias Andree wrote:

> David Relson <relson at users.sourceforge.net> writes:
> 
> > Update of /cvsroot/bogofilter/bogofilter/src
> > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26959
> >
> > Modified Files:
> > 	bogotune.c 
> > Log Message:
> > Handle conflicting open requirements of TrivialDB and Berkeley DB 4.2 (with transactions).
> >
> > Index: bogotune.c
> > ===================================================================
> > RCS file: /cvsroot/bogofilter/bogofilter/src/bogotune.c,v
> > retrieving revision 1.213
> > retrieving revision 1.214
> > diff -u -d -r1.213 -r1.214
> > --- bogotune.c	25 Jun 2005 13:16:52 -0000	1.213
> > +++ bogotune.c	26 Jun 2005 23:48:50 -0000	1.214
> > @@ -1750,7 +1750,12 @@
> >  	
> >  	init_wordlist("word", ds_path, 0, WL_REGULAR);
> >  
> > -	open_wordlists(DS_READ);
> > +	open_wordlists(DS_READ);	/* open to get .ENCODING value */
> > +#ifdef	ENABLE_TDB_DATASTORE
> > +	/* for TrivialDB, a double open fails, so the wordlist must be closed */
> > +	/* with Berkeley DB 4.2 with transactions, closing the wordlist causes a PANIC */
> > +	close_wordlists(false);
> > +#endif
> 
> Something's wrong here - there shouldn't be driver-specific differences,
> and the code should be able to cope with a single opening of the
> wordlists.
> 
> I have currently no interest in bogotune though.

Matthias,

I agree that the #ifdef shouldn't be necessary.  However, my test
script that builds multiple versions of bogofilter and tests them found
problems related to multiple opens.  

It seems that Berkeley DB, Sqlite3, and qdbm don't mind multiple calls
to open_wordlists(), but TDB has a problem with this.  Adding the call
to close_wordlists() caused TDB to work, but causes Berkeley DB 4.2
(with transactions enabled), to complain -- to the degree that a PANIC
message is generated.  

Evidently our database code is adequate for bogofilter and bogoutil,
but isn't fully correct.  I'll dig deeper when I have both time and
inclination.  At the moment, I'm willing to live with this unexpected
dependency.

Regards,

David




More information about the bogofilter-dev mailing list