[spambayes-dev] db_* binaries for Windows, DB_RECOVER
Skip Montanaro
skip at pobox.com
Tue Aug 26 15:21:17 EDT 2003
Dave Segleau at Sleepycat confirmed for me that making Windows binaries of
the Sleepycat db_* utilities available from the SpamBayes website would be
okay. Who can take the time to make them available? We would need to make
sure that db_recover will actually fix Mark Tabash's (and others?) database
file.
He also said that running db_recover isn't the correct solution. The
correct way to do this is to create an environment object with the
DB_RECOVER flag set. That's not compatible with the anydbm interface
however. I see a few possible solutions:
* Special case the situation where whichdb.whichdb() returns "dbhash"
and make direct calls to the relevant bsddb package functions to
create a db object which is resilient in a multi-threaded
environment. This might be done either using Python's lock facilities
or using Sleepycat's environment locks.
* Modify the behavior of bsddb.hashopen() (and cousins) so that it
creates a DBEnv object with the DB_RECOVER flag and passes it to the
DB() constructor:
def hashopen(....):
flags = bsddb._checkflag(flag)
d = bsddb.db.DB(bsddb.db.DBEnv(bsddb.db.DB_RECOVER))
...
bsddb.hashopen = hashopen
* Provide locks around all database file accesses.
Skip
More information about the spambayes-dev
mailing list