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

RE: openLDAP BDB back-end trouble

Hi David,

Though you don't specify, at a guess I'd say you're using OpenLDAP
2.2.something or earlier.

If so, the following applies:

It's not corruption you are sseing, it is leftover locks on the database.
The db_recover command (part of the Berkeley DB distribution) will remove
those locks, replay any transactions that weren't fully recorded, roll back
any uncommitted transactions, and release any locks that existed at the time
of the shutdown. Run this command _before_ starting the slapd process. See
the man page for db_recover for additional information. Also, make sure you
run the db_recover command that is correct for your slapd.

While some folks use run db_recover unconditionally before starting slapd,
we don't advise it because it can slow down slapd startup.

Symas developed and contributed code to back-bdb, back-hdb, and back-ldbm
that detects unclean shutdowns. When this code is triggered, back-bdb and
back-hdb databases are automatically recovered during the next slapd
startup. In the case of back-ldbm the backend will not start up, because
it's a good bet that the database will have errors in it and there is no
error detection or recovery strategy for back-ldbm databases. This
auto-recovery code is now a standard part of OpenLDAP 2.3, obviating the
need for manual db recovery. We back-ported this code to our packaged and
tested distributions of OpenLDAP 2.2, which are called CDS version 2 Silver
(free), and CDS version 2 Gold (fee-based).

I hope this helps.


Matthew Hardin
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org [mailto:owner-openldap-
> software@OpenLDAP.org] On Behalf Of David Schell
> Sent: Monday, July 10, 2006 12:57 PM
> To: openldap-software@OpenLDAP.org
> Subject: openLDAP BDB back-end trouble
> We have been using openLDAP with a BDB backend using Fedora Core 4
> for about a year.  Unfortunately, we periodically experience a
> problem with BDB database corruption preventing openLDAP from
> starting if the server is shut down hard (such as during an extended
> power outage).
> While I have gotten quite good at restoring the database from a
> nightly backup, I was wondering if there were database back-ends that
> would better handle these situations?