[389-commits] ldap/servers

Noriko Hosoi nhosoi at fedoraproject.org
Mon Jun 1 15:56:11 UTC 2015


 ldap/servers/slapd/back-ldbm/dblayer.c              |    7 -------
 ldap/servers/slapd/back-ldbm/ldbm_instance_config.c |    6 ++++--
 2 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit bf9ef718cfd48c26eaf11662f522451d866e7681
Author: Noriko Hosoi <nhosoi at redhat.com>
Date:   Sun May 31 17:08:29 2015 -0700

    Ticket #48190 - idm/ipa 389-ds-base entry cache converges to 500 KB in dblayer_is_cachesize_sane
    
    Description: This issue was introduced by the fix for Ticket 47499
    commit 1e035d1111f6abcb87e760a2b9e41fa9e05a7ebd.
    
    The function dblayer_is_cachesize_sane was originally implemented for
    db cache to check if the given db cache size is larger than the available
    memory or not.  The function resets the size to the available memory size
    if it is larger.  Also, considering the extra metadata size needed for the
    db cache, it multiplies by 0.8 every time it starts the server.  It is not
    needed even for the db cache.  The code is old and we don't have to save
    the memory there.  Thus, this patch removes the resetting code.
    
    https://fedorahosted.org/389/ticket/48190
    
    Reviewed by mreynolds at redhat.com (Thank you, Mark!!)

diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 21a560e..ac315bb 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1116,13 +1116,6 @@ int dblayer_is_cachesize_sane(size_t *cachesize)
     if (!issane) {
         *cachesize = (size_t)((pages - procpages) * pagesize);
     }
-    /* We now compensate for DB's own compensation for metadata size 
-     * They increase the actual cache size by 25%, but only for sizes
-     * less than 500Meg.
-     */
-    if (*cachesize < 500*MEGABYTE) {
-        *cachesize = (size_t)((double)*cachesize * (double)0.8);
-    }
     
     return issane;
 }
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
index 9b93f9a..f75ca97 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
@@ -121,11 +121,12 @@ ldbm_instance_config_cachememsize_set(void *arg, void *value, char *errorbuf, in
     ldbm_instance *inst = (ldbm_instance *) arg;
     int retval = LDAP_SUCCESS;
     size_t val = (size_t) value;
+    size_t chkval = val;
 
     /* Do whatever we can to make sure the data is ok. */
 
     if (apply) {
-        if (!dblayer_is_cachesize_sane(&val)){
+        if (!dblayer_is_cachesize_sane(&chkval)){
             PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE,
                     "Error: cachememsize value is too large.");
             LDAPDebug( LDAP_DEBUG_ANY,"Error: cachememsize value is too large.\n",
@@ -152,11 +153,12 @@ ldbm_instance_config_dncachememsize_set(void *arg, void *value, char *errorbuf,
     ldbm_instance *inst = (ldbm_instance *) arg;
     int retval = LDAP_SUCCESS;
     size_t val = (size_t)value;
+    size_t chkval = val;
 
     /* Do whatever we can to make sure the data is ok. */
 
     if (apply) {
-        if (!dblayer_is_cachesize_sane(&val)){
+        if (!dblayer_is_cachesize_sane(&chkval)){
             PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE,
                     "Error: dncachememsize value is too large.");
             LDAPDebug( LDAP_DEBUG_ANY,"Error: dncachememsize value is too large.\n",




More information about the 389-commits mailing list