On 31/05/14 12:34 PM, Ryan Tandy wrote:
The LMDB backend is now considered stable, and in 2.4.40 upstream will
start to recommend it over hdb as the default backend. For jessie I'd
like for it to at least be included as an option in the debconf menus.
Trivial example of how that might look (modulo a debconf-updatepo) attached.
The default maxsize for back-mdb is 10 MiB, only enough (IMO) for a toy
database. I think we should configure it higher, but I'm not sure how
high. On 32-bit systems there is only so much address space available.
How about a default of 1 GiB? That should fit in the 32-bit address
space but is still significantly larger than any casual user is likely
to have. We should document the size restriction, though, and if
possible provide an example of a cron job to monitor it.
I predict, though, that offering mdb as a configuration choice is going
to result in a lot of people asking for dpkg-reconfigure to be able to
change the backend of an existing database (ie. #599585)...
Actually, AFAICT dpkg-reconfigure is happy to create a new database with
a different backend. Will follow that bug up separately.
I don't know what the format stability of mdb is like (ie. whether, or
when, a dump/reload is required). I will look into that.
IIRC, in 2.4.40 there is a forward-incompatible change: upgrades to
2.4.40 are fine but going back requires a reload. Can't find an ITS
reference right now: might have been an IRC discussion (wishing I kept
better logs) or maybe my brain is starting to invent things...
The disk format will not change backward-incompatibly in 2.4, but it
sounds like it will at the transition to 2.5. ([ITS#7713] is an example
of a format-breaking change.)
[ITS#7713] <http://www.openldap.org/its/?findid=7713>
Out of time for tonight and probably for the weekend, looking forward to
Debconf where I might have some bigger blocks of time for this...
cheers,
Ryan
>From 9e87486c2934c6321fcc76266833904525ace500 Mon Sep 17 00:00:00 2001
From: Ryan Tandy <r...@nardis.ca>
Date: Fri, 8 Aug 2014 21:29:57 -0700
Subject: [PATCH 1/2] re-introduce @BACKENDOPTIONS@ for mdb
---
debian/slapd.init.ldif | 5 +----
debian/slapd.scripts-common | 15 +++++++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/debian/slapd.init.ldif b/debian/slapd.init.ldif
index 6a237e0..6fefcae 100644
--- a/debian/slapd.init.ldif
+++ b/debian/slapd.init.ldif
@@ -62,10 +62,7 @@ objectClass: olcDatabaseConfig
objectClass: @BACKENDOBJECTCLASS@
olcDatabase: @BACKEND@
olcDbCheckpoint: 512 30
-olcDbConfig: set_cachesize 0 2097152 0
-olcDbConfig: set_lk_max_objects 1500
-olcDbConfig: set_lk_max_locks 1500
-olcDbConfig: set_lk_max_lockers 1500
+@BACKENDOPTIONS@
olcLastMod: TRUE
olcSuffix: @SUFFIX@
olcDbDirectory: /var/lib/ldap
diff --git a/debian/slapd.scripts-common b/debian/slapd.scripts-common
index 5427204..5d671b5 100644
--- a/debian/slapd.scripts-common
+++ b/debian/slapd.scripts-common
@@ -460,15 +460,21 @@ create_new_slapd_conf() { # {{{
# Create the new slapd.d directory (configuration)
# Usage: create_new_slapd_conf <basedn> <backend>
- local initldif failed basedn backend backendobjectclass adminpass
+ local initldif failed basedn backend backendobjectclass backendoptions adminpass
# Fetch configuration
basedn="$1"
backend="$2"
- if [ "$backend" = "hdb" ]; then
- backendobjectclass="olcHdbConfig"
+ if [ "$backend" = "mdb" ]; then
+ backendoptions="olcDbMaxSize: 1073741824"
+ backendobjectclass="olcMdbConfig"
else
- backendobjectclass="olcBdbConfig"
+ backendoptions="olcDbConfig: set_cachesize 0 2097152 0\nolcDbConfig: set_lk_max_objects 1500\nolcDbConfig: set_lk_max_locks 1500\nolcDbConfig: set_lk_max_lockers 1500"
+ if [ "$backend" = "hdb" ]; then
+ backendobjectclass="olcHdbConfig"
+ else
+ backendobjectclass="olcBdbConfig"
+ fi
fi
db_get slapd/internal/adminpw
adminpass="$RET"
@@ -484,6 +490,7 @@ create_new_slapd_conf() { # {{{
# Change some defaults
sed -i -e "s|@BACKEND@|$backend|g" ${initldif}
sed -i -e "s|@BACKENDOBJECTCLASS@|$backendobjectclass|g" ${initldif}
+ sed -i -e "s|@BACKENDOPTIONS@|$backendoptions|g" ${initldif}
sed -i -e "s|@SUFFIX@|$basedn|g" ${initldif}
sed -i -e "s|@PASSWORD@|$adminpass|g" ${initldif}
--
2.1.0.rc1
>From 4de312cd174bc4aad91a92f3d1a186a8515392b9 Mon Sep 17 00:00:00 2001
From: Ryan Tandy <r...@nardis.ca>
Date: Fri, 8 Aug 2014 21:30:15 -0700
Subject: [PATCH 2/2] add MDB backend in debconf choices
---
debian/slapd.templates | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/debian/slapd.templates b/debian/slapd.templates
index 551e881..0a1c5d5 100644
--- a/debian/slapd.templates
+++ b/debian/slapd.templates
@@ -131,13 +131,17 @@ _Description: slapcat failure during upgrade
Template: slapd/backend
Type: select
-Choices: BDB, HDB
+Choices: BDB, HDB, MDB
Default: HDB
_Description: Database backend to use:
The HDB backend is recommended. HDB and BDB use similar storage formats,
but HDB adds support for subtree renames. Both support the same
configuration options.
.
+ The MDB backend is a new backend using the Lightning Memory-Mapped
+ Database (LMDB). It relies on the operating system for memory
+ management and requires less configuration.
+ .
In either case, you should review the resulting database configuration
for your needs. See /usr/share/doc/slapd/README.DB_CONFIG.gz for more
details.
--
2.1.0.rc1