[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: HAVE_BERKELEY_DB_THREAD (ITS#1176)



At 10:10 AM 5/27/01, bostic@sleepycat.com wrote:
>We've been approached by an organization that's seeing corruption in
>its databases and I'm trying to understand how OpenLdap uses Berkeley
>DB.

The LDBM backend uses Berkeley DB as a simple key/value store.
There is a new backend under development (back-bdb) which will
use transactions and other advanced features of Berkeley DB 3.

>Basically, I'm concerned about the define HAVE_BERKELEY_DB_THREAD.
>(The only OpenLdap code I've reviewed is ldbm.c.)
>
>It seems to me that if HAVE_BERKELEY_DB_THREAD is defined, multiple
>OpenLdap threads can access Berkeley DB databases concurrently, and,
>there is no provision to restrict this access to read-only threads.
>This concerns me; usually, if multiple threads of control are in the
>database code, and, one of those threads is updating the database,
>there can be deadlocks which require transactional support to resolve.

The backend implements a higher level locking system which orders
access in a manner which should avoid deadlock.

>Can someone please tell me:
>
>+ If HAVE_BERKELEY_DB_THREAD is defined, can multiple OpenLdap threads
>  of control access the Berkeley DB API concurrently?

Yes.


>+ If so, can one of those multiple threads be modifying the database?


Yes.

>  Can two of those multiple threads be modifying the database?

Yes.