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

RE: bdb backend - reliable or not?



Atom Powers wrote:
> 
> Tomasz Chmielewski wrote:
> > Unfortunately, the choice was a disaster - a couple of tests showed that
> > after powering off the server, OpenLDAP is not able to start anymore -
> > all I see in logs is a single message (loglevel 256):
> >
> > bdb_db_open: unclean shutdown detected; attempting recovery.
> >
> > And that's it, it never recovers.
> 
> As others have mentioned, you need to run `db_recover` on your database.

No. Upgrade to a current version of OpenLDAP and let the slapd process
handle the recovery if it's needed.

> > On the other hand, I didn't have problems with ldbm on 2.3.6, or on any
> > older OpenLDAP version, so can one conclude that ldbm is more reliable
> > and crash-resistant?
> 
> More crash-resistant? Probably. BDB has a lot of performance features,
> some of which make it more fragile to system instability. I think you
> will find that almost all "decent" databases, and many other
> applications including the file system itself, have problems with
> unclean shutdowns.

Even LDBM has problems with unclean shutdowns and system instability. It
just doesn't bother to tell you, leaving you to discover them yourself in
the wee hours of the morning. The "decent" databases simply have mechanisms
to catch the problems and recover from them.

> > Will an upgrade to 2.3.24 solve my problems with bdb, or shall I revert
> > back to ldbm?
> 
> Don't use ldbm, unless you have a powerful server and a small number of
> users; and don't mind getting left out of future releases.
> 
> > Performance is not an issue here, databases are relatively small.
> > What is important is the ability to survive unexpected system
> > crash/poweroff.
> 
> Then put the db_recover command in your start-up script, 

That's a BAD idea. OpenLDAP 2.3 automatically recovers the database whenever
recovery is needed. Placing db_recover in the startup script can force an
inadvertent recovery while another process (such as slapadd) is accessing
the database. That would really mess things up.

> and/or tune BDB
> so that it can survive a crash more easily. 

That's a much better idea. Since you say you have a small database,
presumably with low update traffic, set frequent checkpoints. There is
additional information in the OpenLDAP FAQ that will tell you how to tune
back-bdb and bak-hdb.

> But if you are experiencing
> unexpected crash/poweroff I'd say you have more serious issues than
> whether to use ldbm or bdb.

I disagree. Loss of power and system crashes are a reality that needs to be
dealt with. The back-bdb and back-hdb backends are designed with those
situations in mind. 

Cheers,

Matthew Hardin
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
http://www.symas.com

> --
> Perfection is just a word I use occasionally with mustard.
> --Atom Powers--
> Systems Administrator
> DigiPen Institute of Technology
> (425) 895-4443