[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-technical
Subject:    Re: [lmdb] MDB_BAD_DBI error upon mdb_txn_commit (newbie question)
From:       Hallvard Breien Furuseth <h.b.furuseth () usit ! uio ! no>
Date:       2015-03-30 11:52:15
Message-ID: 551938EF.5010609 () usit ! uio ! no
[Download RAW message or body]


You're abusing mdb_dbi_open().  Its doc says:

   "This function must not be called from multiple concurrent
   transactions in the same process. A transaction that uses this
   function must finish (either commit or abort) before any other
   transaction in the process may use this function."

That text could have stood out a bit better in the doc:-(

The error is simple for lmdb to try to catch, though without
locking it cannot guarantee to catch it.  Try this patch:
<http://folk.uio.no/hbf/OpenLDAP/mdb.serial-open.diff>

(Howard, this is branch "mdb/serial-open" in my UiO repo.)
Not sure if it should do more than this.  E.g. attack mdb_drop
too.  Maybe set MDB_TXN_ERROR since a program with broken
threading can break the DB.

-- 
Hallvard



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic