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

RE: BDB corruption on every unclean shutdown



> -----Original Message-----
> From: dbroady@lexmark.com [mailto:dbroady@lexmark.com]

> Howard,
>
> > If you want to avoid this hassle, in OpenLDAP 2.2 you can configure
> > back-bdb
> > to use shared memory instead of files, that way no stale locks will
> > remain after a system crash.
>
> I am a little curious about this.  Aside from stale locks not remaining
> after a system crash, what are other benefits on using this over
> memory-mapped files?

It depends very much on the operating system you're using. In most cases
there's
no difference. In some, changes to memory-mapped files are flushed to disk
more frequently,
and using shared memory avoids this unnecessary overhead. There are
disadvantages too - your database startup time after a system boot is longer
because there is no cache context preserved from before.

> Also, correct me if I'm wrong, but doesn't this
> decision have to be made at database creation time and can
> not be changed
> afterwards without recreating the database?

The decision has to be made at *environment* creation time. db_recover
destroys the existing environment by default, so you can make any changes at
that point.

> Is it possible to only specify
> that only the locking subsystems uses shared-memory and that the other
> subsystems use memory-mapped files?

See the BDB documentation, look for the DB_SYSTEM_MEM flag for DB_ENV->open.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support