slapd: checkpoint directive missed from bdb backend
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap2.2 (Debian) |
Fix Released
|
Unknown
|
|||
openldap2.2 (Ubuntu) |
Invalid
|
High
|
Fabio Massimo Di Nitto |
Bug Description
Automatically imported from Debian bug report #272984 http://
Debian Bug Importer (debzilla) wrote : | #1 |
Debian Bug Importer (debzilla) wrote : | #2 |
Message-Id: <email address hidden>
Date: Thu, 23 Sep 2004 09:36:17 +0100
From: Doug Winter <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: slapd: checkpoint directive missed from bdb backend
Package: slapd
Version: 2.1.30-3
Severity: critical
Justification: causes serious data loss
When the slapd package is installed, it writes an /etc/ldap/
file automatically, based on user input.
By default this uses the bdb backend. Without a "checkpoint" directive
in the configuration file, the bdb database never checkpoints, which
means that if the system fails without shutting slapd down cleanly all
changes made are lost.
This happened to me several times because of power issues in our
facility, which was immensely frustrating :)
If the bdb backend is used, there should always be a checkpoint entry.
Cheers,
Doug.
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (900, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-k7-smp
Locale: LANG=en_GB, LC_CTYPE=en_GB
Versions of packages slapd depends on:
ii coreutils [fileutils] 5.0.91-2 The GNU core utilities
ii debconf 1.4.29 Debian configuration management sy
ii fileutils 5.0.91-2 The GNU file management utilities
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-16 Berkeley v4.2 Database Libraries [
ii libgcrypt11 1.2.0-4 LGPL Crypto library - runtime libr
ii libgnutls11 1.0.16-3 GNU TLS library - runtime library
ii libgpg-error0 0.7-1 library for common error values an
ii libiodbc2 3.51.2-2 iODBC Driver Manager
ii libldap2 2.1.30-3 OpenLDAP libraries
ii libltdl3 1.5.6-1 A system independent dlopen wrappe
ii libsasl2 2.1.18-4.1 Authentication abstraction library
ii libslp1 1.0.11-7 OpenSLP libraries
ii libwrap0 7.6.dbs-4 Wietse Venema's TCP wrappers libra
ii perl [libmime-
ii psmisc 21.4-1 Utilities that use the proc filesy
ii zlib1g 1:1.2.1-5 compression library - runtime
-- debconf information:
slapd/
slapd/
slapd/
* shared/
slapd/
slapd/
slapd/backend: BDB
* slapd/allow_
slapd/
slapd/
slapd/
slapd/
slapd/
slapd/
slapd/admin:
* slapd/domain: icpeurope.net
Fabio Massimo Di Nitto (fabbione) wrote : | #3 |
Fixed with openldap2_
In Debian Bug tracker #272984, Stephen Frost (sfrost) wrote : | #4 |
Greetings,
The bdb backend has 'dbnosync' off by default which means that changes
should be sync'd to disk immediately. I think you may have a problem
elsewhere. Did you try to dbrecover? When dbnosync is off, what does
checkpoint do, exactly? My best guess is that it writes a checkpoint,
which may mean you don't have to dbrecover but at the same time,
everything between that checkpoint and the time the machine crashed
would be lost.
This bug isn't 'critical'. It might be normal, maybe.
Stephen
Debian Bug Importer (debzilla) wrote : | #5 |
Message-ID: <email address hidden>
Date: Thu, 21 Oct 2004 08:28:09 -0400
From: Stephen Frost <email address hidden>
To: <email address hidden>
Subject: Re: slapd: checkpoint directive missed from bdb backend
--uX2tiToO0oGq+LKk
Content-Type: text/plain; charset=us-ascii
Content-
Greetings,
The bdb backend has 'dbnosync' off by default which means that changes
should be sync'd to disk immediately. I think you may have a problem
elsewhere. Did you try to dbrecover? When dbnosync is off, what does
checkpoint do, exactly? My best guess is that it writes a checkpoint,
which may mean you don't have to dbrecover but at the same time,
everything between that checkpoint and the time the machine crashed
would be lost.
This bug isn't 'critical'. It might be normal, maybe.
Stephen
--uX2tiToO0oGq+LKk
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBd6tZrzg
BvJqfIumWPaVrmh
=GTgL
-----END PGP SIGNATURE-----
--uX2tiToO0oGq+
In Debian Bug tracker #272984, Torsten Landschoff (torsten) wrote : Re: Bug#272984: slapd: checkpoint directive missed from bdb backend | #6 |
Hi,
On Thu, Oct 21, 2004 at 08:28:09AM -0400, Stephen Frost wrote:
> The bdb backend has 'dbnosync' off by default which means that changes
> should be sync'd to disk immediately. I think you may have a problem
> elsewhere. Did you try to dbrecover? When dbnosync is off, what does
> checkpoint do, exactly? My best guess is that it writes a checkpoint,
> which may mean you don't have to dbrecover but at the same time,
> everything between that checkpoint and the time the machine crashed
> would be lost.
>
> This bug isn't 'critical'. It might be normal, maybe.
I've read up on Berkeley DB transactions and it seems to me that it
would make sense to write a checkpoint from time to time. No data should
be lost but in the default configuration slapd only checkpoints the DB
during shutdown which means that reopening the database after a crash
(which looks for me like the only reason why slapd would go down short
of a system reboot) will take a lot of time wading through old log
files.
I don't want to mess with the slapd defaults for this small problem
though and I wonder what upstream has to say. AFAICT the checkpoint
directive leads to a massive breakdown of write performance for not that
much gain.
Greetings
Torsten
In Debian Bug tracker #272984, Torsten Landschoff (t-landschoff) wrote : tagging 272984 | #7 |
tags 272984 upstream
In Debian Bug tracker #272984, Torsten Landschoff (t-landschoff) wrote : severity of 272984 is minor | #8 |
severity 272984 minor
In Debian Bug tracker #272984, Torsten Landschoff (torsten) wrote : Checkpointing in slapd bdb backend? | #9 |
Hi all,
A Debian user reported about a missing checkpoint directive in
slapd.conf leading to data loss (see http://
can't imagine how that would happen but I wonder why checkpointing is
only done during shutdown of slapd by default (I'd expect that to happen
really seldom).
I'd rather have the default changed if it increases data security
or slapd behaviour in case of a system crash. But I guess that's
upstreams call.
Comments?
Greetings
Torsten
Debian Bug Importer (debzilla) wrote : | #10 |
Message-Id: <email address hidden>
Date: Tue, 9 Nov 2004 01:38:12 +0100 (CET)
From: <email address hidden> (Torsten Landschoff)
To: <email address hidden>
Subject: tagging 272984
tags 272984 upstream
Debian Bug Importer (debzilla) wrote : | #11 |
Message-Id: <email address hidden>
Date: Tue, 9 Nov 2004 01:38:22 +0100 (CET)
From: <email address hidden> (Torsten Landschoff)
To: <email address hidden>
Subject: severity of 272984 is minor
severity 272984 minor
Debian Bug Importer (debzilla) wrote : | #12 |
Message-ID: <email address hidden>
Date: Tue, 9 Nov 2004 01:37:50 +0100
From: Torsten Landschoff <email address hidden>
To: <email address hidden>
Subject: Re: Bug#272984: slapd: checkpoint directive missed from bdb backend
--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-
Content-
Hi,=20
On Thu, Oct 21, 2004 at 08:28:09AM -0400, Stephen Frost wrote:
> The bdb backend has 'dbnosync' off by default which means that changes
> should be sync'd to disk immediately. I think you may have a problem
> elsewhere. Did you try to dbrecover? When dbnosync is off, what does
> checkpoint do, exactly? My best guess is that it writes a checkpoint,
> which may mean you don't have to dbrecover but at the same time,
> everything between that checkpoint and the time the machine crashed
> would be lost.
>=20
> This bug isn't 'critical'. It might be normal, maybe.
I've read up on Berkeley DB transactions and it seems to me that it
would make sense to write a checkpoint from time to time. No data should
be lost but in the default configuration slapd only checkpoints the DB
during shutdown which means that reopening the database after a crash=20
(which looks for me like the only reason why slapd would go down short
of a system reboot) will take a lot of time wading through old log
files.
I don't want to mess with the slapd defaults for this small problem
though and I wonder what upstream has to say. AFAICT the checkpoint
directive leads to a massive breakdown of write performance for not that=20
much gain.=20
Greetings
Torsten
--vtzGhvizbBRQ85DL
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBkBFedQg
sPPCt7fnH5qeBsC
=uWH+
-----END PGP SIGNATURE-----
--vtzGhvizbBRQ8
Debian Bug Importer (debzilla) wrote : | #13 |
Message-ID: <email address hidden>
Date: Tue, 9 Nov 2004 01:49:47 +0100
From: Torsten Landschoff <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: Checkpointing in slapd bdb backend?
--EuxKj2iCbKjpUGkD
Content-Type: text/plain; charset=us-ascii
Content-
Content-
Hi all,=20
A Debian user reported about a missing checkpoint directive in
slapd.conf leading to data loss (see http://
can't imagine how that would happen but I wonder why checkpointing is
only done during shutdown of slapd by default (I'd expect that to happen
really seldom).
I'd rather have the default changed if it increases data security=20
or slapd behaviour in case of a system crash. But I guess that's=20
upstreams call.=20
Comments?
Greetings
Torsten
--EuxKj2iCbKjpUGkD
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBkBQrdQg
HUBjmCxZDlP0VHP
=oKAy
-----END PGP SIGNATURE-----
--EuxKj2iCbKjpU
In Debian Bug tracker #272984, Doug Winter (winjer) wrote : Re: Bug#272984: slapd: checkpoint directive missed from bdb backend | #14 |
Torsten Landschoff wrote:
> I've read up on Berkeley DB transactions and it seems to me that it
> would make sense to write a checkpoint from time to time. No data should
> be lost but in the default configuration slapd only checkpoints the DB
> during shutdown which means that reopening the database after a crash
> (which looks for me like the only reason why slapd would go down short
> of a system reboot) will take a lot of time wading through old log
> files.
>
> I don't want to mess with the slapd defaults for this small problem
> though and I wonder what upstream has to say. AFAICT the checkpoint
> directive leads to a massive breakdown of write performance for not that
> much gain.
I have lost significant data because this directive wasn't in the
logfile, and I didn't know how to recover a berkeley db. The third
time this happened I spent several hours reading up on it and managed to
get my data back. If slapd or the system crashes (in this case it was
because of a power outage), then the database needs to be manually
recovered.
It doesn't happen automatically, so can lead to data loss if the
database is not recovered.
doug.
--
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
http://
Debian Bug Importer (debzilla) wrote : | #15 |
Message-ID: <email address hidden>
Date: Tue, 09 Nov 2004 07:41:42 +0000
From: Doug Winter <email address hidden>
To: Torsten Landschoff <email address hidden>,
<email address hidden>
Subject: Re: Bug#272984: slapd: checkpoint directive missed from bdb backend
Torsten Landschoff wrote:
> I've read up on Berkeley DB transactions and it seems to me that it
> would make sense to write a checkpoint from time to time. No data should
> be lost but in the default configuration slapd only checkpoints the DB
> during shutdown which means that reopening the database after a crash
> (which looks for me like the only reason why slapd would go down short
> of a system reboot) will take a lot of time wading through old log
> files.
>
> I don't want to mess with the slapd defaults for this small problem
> though and I wonder what upstream has to say. AFAICT the checkpoint
> directive leads to a massive breakdown of write performance for not that
> much gain.
I have lost significant data because this directive wasn't in the
logfile, and I didn't know how to recover a berkeley db. The third
time this happened I spent several hours reading up on it and managed to
get my data back. If slapd or the system crashes (in this case it was
because of a power outage), then the database needs to be manually
recovered.
It doesn't happen automatically, so can lead to data loss if the
database is not recovered.
doug.
--
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
http://
In Debian Bug tracker #272984, Stephen Frost (sfrost) wrote : Re: [debian-openldap] Bug#272984: slapd: checkpoint directive missed from bdb backend | #16 |
* Doug Winter (<email address hidden>) wrote:
> Torsten Landschoff wrote:
> >I've read up on Berkeley DB transactions and it seems to me that it
> >would make sense to write a checkpoint from time to time. No data should
> >be lost but in the default configuration slapd only checkpoints the DB
> >during shutdown which means that reopening the database after a crash
> >(which looks for me like the only reason why slapd would go down short
> >of a system reboot) will take a lot of time wading through old log
> >files.
> >
> >I don't want to mess with the slapd defaults for this small problem
> >though and I wonder what upstream has to say. AFAICT the checkpoint
> >directive leads to a massive breakdown of write performance for not that
> >much gain.
>
> I have lost significant data because this directive wasn't in the
> logfile, and I didn't know how to recover a berkeley db. The third
> time this happened I spent several hours reading up on it and managed to
> get my data back. If slapd or the system crashes (in this case it was
> because of a power outage), then the database needs to be manually
> recovered.
>
> It doesn't happen automatically, so can lead to data loss if the
> database is not recovered.
The point is that the database *can* be recovered unless something worse
has happened (such as file system corruption). Just because you can't
open it immediately upon reboot doesn't mean the data has been lost.
Torsten, perhaps we could add something to the README about how to use a
Berkley db, with some URLs to more documentation.
Stephen
In Debian Bug tracker #272984, Torsten Landschoff (torsten) wrote : | #17 |
Hi Stephen,
On Tue, Nov 09, 2004 at 07:29:08AM -0500, Stephen Frost wrote:
> > It doesn't happen automatically, so can lead to data loss if the
> > database is not recovered.
>
> The point is that the database *can* be recovered unless something worse
> has happened (such as file system corruption). Just because you can't
> open it immediately upon reboot doesn't mean the data has been lost.
> Torsten, perhaps we could add something to the README about how to use a
> Berkley db, with some URLs to more documentation.
After skipping through the DB docs I am sure you could write a book
about that... Therefore I'll just add some little notes.
Speaking about db_recover: Originally that was done automatically in
slapd. It was dropped exactly because data loss could result. Recovering
the database is risky in the sense that doing it twice at the same time
/will/ kill your data. AFAIK power loss during database recovery could
also result in complete data loss.
So basically you should backup your db before running recover. Which is
another good reason to not do it automatically.
Greetings
Torsten
Debian Bug Importer (debzilla) wrote : | #18 |
Message-ID: <email address hidden>
Date: Tue, 9 Nov 2004 07:29:08 -0500
From: Stephen Frost <email address hidden>
To: Doug Winter <email address hidden>, <email address hidden>
Cc: Torsten Landschoff <email address hidden>
Subject: Re: [debian-openldap] Bug#272984: slapd: checkpoint directive missed from bdb backend
--QwcgtzFXO4v1D05N
Content-Type: text/plain; charset=us-ascii
Content-
Content-
* Doug Winter (<email address hidden>) wrote:
> Torsten Landschoff wrote:
> >I've read up on Berkeley DB transactions and it seems to me that it
> >would make sense to write a checkpoint from time to time. No data should
> >be lost but in the default configuration slapd only checkpoints the DB
> >during shutdown which means that reopening the database after a crash=20
> >(which looks for me like the only reason why slapd would go down short
> >of a system reboot) will take a lot of time wading through old log
> >files.
> >
> >I don't want to mess with the slapd defaults for this small problem
> >though and I wonder what upstream has to say. AFAICT the checkpoint
> >directive leads to a massive breakdown of write performance for not that=
=20
> >much gain.=20
>=20
> I have lost significant data because this directive wasn't in the=20
> logfile, and I didn't know how to recover a berkeley db. The third=20
> time this happened I spent several hours reading up on it and managed to=
=20
> get my data back. If slapd or the system crashes (in this case it was=20
> because of a power outage), then the database needs to be manually=20
> recovered.
>=20
> It doesn't happen automatically, so can lead to data loss if the=20
> database is not recovered.
The point is that the database *can* be recovered unless something worse
has happened (such as file system corruption). Just because you can't
open it immediately upon reboot doesn't mean the data has been lost.
Torsten, perhaps we could add something to the README about how to use a
Berkley db, with some URLs to more documentation.
Stephen
--QwcgtzFXO4v1D05N
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFBkLgUrzg
RoQ+a2DUvKxYaCe
=DGiL
-----END PGP SIGNATURE-----
--QwcgtzFXO4v1D
Debian Bug Importer (debzilla) wrote : | #19 |
Message-ID: <email address hidden>
Date: Tue, 9 Nov 2004 13:47:47 +0100
From: Torsten Landschoff <email address hidden>
To: Stephen Frost <email address hidden>
Cc: Doug Winter <email address hidden>, <email address hidden>
Subject: Re: [debian-openldap] Bug#272984: slapd: checkpoint directive missed from bdb backend
--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=us-ascii
Content-
Content-
Hi Stephen,=20
On Tue, Nov 09, 2004 at 07:29:08AM -0500, Stephen Frost wrote:
> > It doesn't happen automatically, so can lead to data loss if the=20
> > database is not recovered.
>=20
> The point is that the database *can* be recovered unless something worse
> has happened (such as file system corruption). Just because you can't
> open it immediately upon reboot doesn't mean the data has been lost.
> Torsten, perhaps we could add something to the README about how to use a
> Berkley db, with some URLs to more documentation.
After skipping through the DB docs I am sure you could write a book
about that... Therefore I'll just add some little notes.=20
Speaking about db_recover: Originally that was done automatically in
slapd. It was dropped exactly because data loss could result. Recovering
the database is risky in the sense that doing it twice at the same time
/will/ kill your data. AFAIK power loss during database recovery could
also result in complete data loss.=20
So basically you should backup your db before running recover. Which is
another good reason to not do it automatically.=20
Greetings
Torsten
--UlVJffcvxoiEqYs2
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBkLxydQg
TjVjiGWvpNZxjT8
=ECvg
-----END PGP SIGNATURE-----
--UlVJffcvxoiEq
In Debian Bug tracker #272984, Doug Winter (winjer) wrote : | #20 |
Stephen Frost wrote:
> The point is that the database *can* be recovered unless something worse
> has happened (such as file system corruption). Just because you can't
> open it immediately upon reboot doesn't mean the data has been lost.
> Torsten, perhaps we could add something to the README about how to use a
> Berkley db, with some URLs to more documentation.
Something in the README saying either put in a checkpoint, or this is
how to recover after a crash would save a lot of people some grief I
think. For a lot of us, performance is unimportant compared to data
integrity ;)
doug.
--
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
http://
Debian Bug Importer (debzilla) wrote : | #21 |
Message-ID: <email address hidden>
Date: Tue, 09 Nov 2004 20:26:23 +0000
From: Doug Winter <email address hidden>
To: <email address hidden>
Subject: Re: [debian-openldap] Bug#272984: slapd: checkpoint directive missed
from bdb backend
Stephen Frost wrote:
> The point is that the database *can* be recovered unless something worse
> has happened (such as file system corruption). Just because you can't
> open it immediately upon reboot doesn't mean the data has been lost.
> Torsten, perhaps we could add something to the README about how to use a
> Berkley db, with some URLs to more documentation.
Something in the README saying either put in a checkpoint, or this is
how to recover after a crash would save a lot of people some grief I
think. For a lot of us, performance is unimportant compared to data
integrity ;)
doug.
--
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
http://
In Debian Bug tracker #272984, Matthijs Mohlmann (matthijs) wrote : | #22 |
Hi,
There is documentation in README.DB_CONFIG which explains how to tune the BDB/HDB backend. There is also referred to the checkpoint directive. Closing bugreport.
Regards,
Matthijs Mohlmann
Changed in openldap2.2: | |
status: | Confirmed → Fix Released |
Automatically imported from Debian bug report #272984 http:// bugs.debian. org/272984