corrupted databases on OSX -
11-01-2006
, 01:05 PM
We use bsddb for our database needs in our app Democracy.
Specifically, we use pybsddb.
Unfortunately, we often get databases that are corrupted beyond repair.
The main bug in our trac installation is at
https://develop.participatoryculture...cy/ticket/3661
Specifically, we're getting this exception:
DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, run database
recovery -- unable to join the environment')
As I understand, this shouldn't be possible without disk corruption,
based on how we load the database. Also, we don't see any such
problems on linux or windows. Is this a known bug? What can I do to
further debug this issue?
Our code to open the database looks like this:
self.dbenv = bsddb.db.DBEnv()
self.dbenv.set_flags (bsddb.db.DB_AUTO_COMMIT | bsddb.db.DB_TXN_NOSYNC,
True)
self.dbenv.set_lg_max (1024 * 1024)
self.dbenv.open (self.dbPath, bsddb.db.DB_INIT_LOG |
bsddb.db.DB_INIT_MPOOL | bsddb.db.DB_INIT_TXN | bsddb.db.DB_RECOVER |
bsddb.db.DB_CREATE)
self.db = bsddb.db.DB(self.dbenv)
and then either:
self.db.open ("database", flags = bsddb.db.DB_CREATE, dbtype =
bsddb.db.DB_HASH, txn=self.txn)
or:
self.db.open ("database") |