Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up, I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.
- Golden
On 10/6/06, Golden Butler golden@cnt.org wrote:
Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up,
I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.
Set a more sane checkpoint interval. Run db_recover before you start the server again.
--On Friday, October 06, 2006 11:46 AM -0500 Golden Butler golden@cnt.org wrote:
Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up,
I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.
Hi,
You don't say what backend you are using, but I'll assume bdb or hdb, since you don't want to use ldbm. See the "checkpoint" directive in the slapd-bdb(5) man page. This issue has been discussed many many times on the software list. Of course, I recommend you be using OpenLDAP 2.3 as well, since IIRC, the checkpoint directive didn't function entirely as intended in OpenLDAP 2.2.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
"Golden Butler" golden@cnt.org writes:
:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40%22%3E
Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up,:p>
I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.:p>
:p>
- Golden:p>
In general slapd writes to disk as soon as possible, depending on pending read operations, that is, a delay of a few seconds my occur. Not writing to disk for a few month seems to be quite odd.If you use a bdb or hdb database you might try to recover the database by means of db_recover. In order to force slapd to write to disk you may define a checkpoint in slapd.conf(5)
-Dieter
--On Friday, October 06, 2006 9:36 PM +0200 Dieter Kluenter dieter@dkluenter.de wrote:
"Golden Butler" golden@cnt.org writes:
:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40%22%3E
Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up,:p>
I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.:p>
:p>
- Golden:p>
In general slapd writes to disk as soon as possible, depending on pending read operations, that is, a delay of a few seconds my occur. Not writing to disk for a few month seems to be quite odd.If you use a bdb or hdb database you might try to recover the database by means of db_recover. In order to force slapd to write to disk you may define a checkpoint in slapd.conf(5)
IIRC, it only flushes to disk when told to, which is either via the checkpoint settings, or a *normal* slapd shutdown. Otherwise, it does not. So his scenario makes perfect sense to me. Assuming the cache setting holds the entire DB, I believe.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
--On Friday, October 06, 2006 12:59 PM -0700 Quanah Gibson-Mount quanah@stanford.edu wrote:
IIRC, it only flushes to disk when told to, which is either via the checkpoint settings, or a *normal* slapd shutdown. Otherwise, it does not. So his scenario makes perfect sense to me. Assuming the cache setting holds the entire DB, I believe.
Never mind, I was forgetting the BDB logs get updated on every write. He just needed to run db_recover or use OL 2.3 instead.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Quanah Gibson-Mount quanah@stanford.edu writes:
--On Friday, October 06, 2006 9:36 PM +0200 Dieter Kluenter dieter@dkluenter.de wrote:
"Golden Butler" golden@cnt.org writes:
[...]
In general slapd writes to disk as soon as possible, depending on pending read operations, that is, a delay of a few seconds my occur. Not writing to disk for a few month seems to be quite odd.If you use a bdb or hdb database you might try to recover the database by means of db_recover. In order to force slapd to write to disk you may define a checkpoint in slapd.conf(5)
IIRC, it only flushes to disk when told to, which is either via the checkpoint settings, or a *normal* slapd shutdown. Otherwise, it does not. So his scenario makes perfect sense to me. Assuming the cache setting holds the entire DB, I believe.
AfAIK, this is only true if the flag DB_TXN_NOSYNC is set. But even than the cache is flushed at an idle state of operations.
-Dieter
Hello,
Golden Butler schrieb:
Yesterday, we lost power due to an power outage and our openldap server went down. When power was restored and the server was back up,
I noticed that a lot of entries that I have entered over a period of time (about two months) were gone! Is there a way to ensure that openldap write changes to the database to disk instantly? Any help or suggestions would be greatly appreciated, thanks.
- Golden
You are using SLES9 SP2? At this release was a Kernel-Bug, that produced such a problem. You can reproduce by viewing a directory-listing of /var/lib/ldap and change entries. If the files do not change, you have such a problem.
I have the same problem a couple of days ago and hope to found the solution with upgrade to SP3.
Ragarding Matthias
openldap-software@openldap.org