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

Database deadlock when adding new entry



Hi,

I'm experiencing database deadlocks when adding new entry into the directory. In short, all works fine for some time, than I attempt to add new entry into the directory, and LDAP server (slapd) simply hangs. I'm still able to bind to the server, however any operation after that (read or write) will simply hang. If I restart slapd, it hangs while initializing bdb (DB4) backend and never starts listening on network port. These are the last entries in log files before slapd hangs on restart:

Jun 19 11:03:40 ldap1 slapd[20331]: bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)
Jun 19 11:03:40 ldap1 slapd[20331]: bdb_db_init: Initializing BDB database


The only way to get out of this that I found so far is to stop slapd, remove all database files in /var/lib/ldap directory, start slapd and use ldapadd to readd all the old entries back. If I attempt to add same entry again, it hangs again. However, if the same entry is added using ldapadd with all the old entries, it works!?

I've attempted to reproduce the problem on my testing box. If I use ldapadd to add all the old entries (like the way I was reinitializing database on production box), and than add the new entry, all works fine. If I copy the raw database files directly from the production box, than slapd hangs on startup just like the production box. So my guess is that something in the database files got corrupted.

The only difference between production and testing box is that production box is replicated (using syncrepl). Replication is one way, all updates are done on the master (the one that hangs), and slaves (which are read-only) pull the changes. When the master hangs, I'm still able to read out data from slaves.

I'm using CentOS4 (RHEL4 clone) openldap-2.2.13-4 and db4-4.2.52-7.1 RPM packages. Database backend is bdb.

Wondering if this is a known issue (maybe already fixed in current version of openldap or db4?) or something new? Anything I might try changing in slapd or DB4 config?

--
See Ya' later, alligator!
http://www.8-P.ca/