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

RE: guaranteed up-to-date BDB backup?

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Hallvard B

> If I add/modify/delete an entry and wait for the operation to return,
> and then backup the BDB database with db_dump (or slapcat?), is the
> backup guaranteed to contain the update?  (The dbnosync config option
> is not set.)

Yes. The request is committed before returning, and the commit forces the
data out. The only thing that dbnosync does is turn off flushes of the
transaction logs - that means that in the event of a crash, the log file may
not be complete, and if you need to do a rollback/recovery then some
committed transactions may be undone/disappear.

I should note that your OS must support shared mutexes (i.e., interprocess
mutexes) otherwise you cannot safely run other tools concurrent with slapd.
Not all platforms that provide a pthreads library support sharing of pthreads
mutexes between processes (they only support it between threads in a single
process), so you need to verify that your BDB build works correctly before
you can use this feature. (This is one very good reason why back-bdb uses BDB
locks instead of just using the regular pthreads mutexes that the rest of
slapd uses. This is also why BDB 4.1 must be patched before using it on
OS/390, because OS/390's pthreads library doesn't support shared mutexes.)

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