From: Quanah Gibson-Mount Date: Fri, 19 Jun 2009 23:53:41 +0000 (+0000) Subject: ITS#6176 X-Git-Tag: OPENLDAP_REL_ENG_2_4_17~39 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c2261c69083fefb920dd99b009ef06d49a1781e2;p=openldap ITS#6176 --- diff --git a/CHANGES b/CHANGES index f624771a9c..52b1fffef5 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ OpenLDAP 2.4.17 Engineering Fixed slapd sockets usage on windows (ITS#6039) Fixed slapd some abandon and cancel race conditions (ITS#6104) Fixed slapd tls context after changes (ITS#6135) + Fixed slapd-bdb/hdb adjust dncachesize if too low (ITS#6176) Fixed slapd-hdb freeing of already freed entries (ITS#6074) Fixed slapd-hdb entryinfo cleanup (ITS#6088) Fixed slapd-hdb dncache lockups (ITS#6095) diff --git a/doc/man/man5/slapd-bdb.5 b/doc/man/man5/slapd-bdb.5 index ec3210e0ae..f0a6d4cf92 100644 --- a/doc/man/man5/slapd-bdb.5 +++ b/doc/man/man5/slapd-bdb.5 @@ -147,7 +147,10 @@ will return a different result. .BI dncachesize \ Specify the maximum number of DNs in the in-memory DN cache. The default is twice the \fBcachesize\fP. Ideally this cache should be -large enough to contain the DNs of every entry in the database. +large enough to contain the DNs of every entry in the database. If +set to a smaller value than the \fBcachesize\fP it will be silently +increased to equal the \fBcachesize\fP. + It should be noted that the \fBDN cache\fP is allowed to temporarily grow beyond the configured size. It does this if many entries are locked when it tries to do a purge, because that means they're diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 653d0e9e78..fe480e59a9 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -374,6 +374,11 @@ shm_retry: bdb->bi_cache.c_eimax = bdb->bi_cache.c_maxsize * 2; } + /* dncache must be >= entrycache */ + if ( bdb->bi_cache.c_eimax < bdb->bi_cache.c_maxsize ) { + bdb->bi_cache.c_eimax = bdb->bi_cache.c_maxsize; + } + if ( bdb->bi_idl_cache_max_size ) { bdb->bi_idl_tree = NULL; bdb->bi_idl_cache_size = 0;