]> git.sur5r.net Git - openldap/commitdiff
ITS#6176 silently raise dncache to cachesize if smaller
authorHoward Chu <hyc@openldap.org>
Thu, 18 Jun 2009 00:16:30 +0000 (00:16 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 18 Jun 2009 00:16:30 +0000 (00:16 +0000)
doc/man/man5/slapd-bdb.5
servers/slapd/back-bdb/init.c

index ec3210e0ae6d5b7890d3a6e1a1bd0f4a9e973632..f0a6d4cf920543dc8cd1f34a0fdcaa8351dc0069 100644 (file)
@@ -147,7 +147,10 @@ will return a different result.
 .BI dncachesize \ <integer>
 Specify the maximum number of DNs in the in-memory DN cache. The
 default is twice the \fBcachesize\fP. Ideally this cache should be
 .BI dncachesize \ <integer>
 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
 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
index 653d0e9e782e5b2c6fb90f9b24a3ba028ed56dc1..fe480e59a931f4822ec7e11346d2651dd49382e4 100644 (file)
@@ -374,6 +374,11 @@ shm_retry:
                bdb->bi_cache.c_eimax = bdb->bi_cache.c_maxsize * 2;
        }
 
                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;
        if ( bdb->bi_idl_cache_max_size ) {
                bdb->bi_idl_tree = NULL;
                bdb->bi_idl_cache_size = 0;