#47499 [ RFE ] :: if nsslapd-cachememsize set to the number larger than the RAM available, should result in proper error message.
Closed: wontfix None Opened 7 years ago by rmeggins.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Directory Server): Bug 923799

Please note that this Bug is private and may not be accessible as it contains confidential Red Hat customer information.

Description of problem:
if nsslapd-cachememsize set to the number larger than the RAM available, should
result in proper error message.

Steps to Reproduce:
I tried giving a higher value of 1000GB to dn: cn=userRoot,cn=ldbm
database,cn=plugins,cn=config's nsslapd-cachememsize from console,
and the server crashed.

Error ::
>>> ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
>>> < - deleted
>>> > - added
>>> 1,28d0
>>> < # extended LDIF
>>> < #
>>> < # LDAPv3
>>> < # base <cn=userRoot,cn=ldbm database,cn=plugins,cn=config> with
>>> scope baseObject
>>> < # filter: objectclass=*
>>> < # requesting: ALL
>>> < #
>>> <
>>> < # userRoot, ldbm database, plugins, config
>>> < dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config
>>> < objectClass: top
>>> < objectClass: extensibleObject
>>> < objectClass: nsBackendInstance
>>> < cn: userRoot
>>> < nsslapd-suffix: dc=example,dc=com
>>> < nsslapd-cachesize: -1
>>> < nsslapd-cachememsize: 1073741824
>>> < nsslapd-readonly: off
>>> < nsslapd-require-index: off
>>> < nsslapd-directory: /var/lib/dirsrv/slapd-mgmt12/db/userRoot
>>> < nsslapd-dncachememsize: 10485760
>>> <
>>> < # search result
>>> < search: 2
>>> < result: 0 Success
>>> <
>>> < # numResponses: 2
>>> < # numEntries: 1
>>>
>>> ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
>>>
>>>
>>> [root@mgmt12 scripts]# service dirsrv status
>>> dirsrv mgmt12 dead but pid file exists
>>>
>>> [root@mgmt12 scripts]# tail -f /var/log/dirsrv/slapd-mgmt12/errors
>>> [19/Mar/2013:07:22:31 -0400] memory allocator - calloc of 1 elems of
>>> 268435664 bytes failed; OS error 12 (Cannot allocate memory)
>>> The server has probably allocated all available virtual memory. To solve
>>> this problem, make more virtual memory available to your server, or
>>> reduce
>>> one or more of the following server configuration settings:
>>>   nsslapd-cachesize        (Database Settings - Maximum entries in
>>> cache)
>>>   nsslapd-cachememsize     (Database Settings - Memory available for
>>> cache)
>>>   nsslapd-dbcachesize      (LDBM Plug-in Settings - Maximum cache size)
>>>   nsslapd-import-cachesize (LDBM Plug-in Settings - Import cache size).
>>> Can't recover; calling exit(1).
>>>
>>>
>>> [root@mgmt12 scripts]# cat /proc/meminfo
>>> MemTotal:       16396852 kB
>>> MemFree:        13973916 kB
>>> Buffers:          211892 kB
>>> Cached:          1460572 kB
>>> SwapCached:            0 kB
>>>
>>> #free -m
>>>              total       used       free     shared    buffers
>>> cached
>>> Mem:         16012       2366      13646          0        206
>>> 1426
>>> -/+ buffers/cache:        732      15279
>>> Swap:         8071          0       8071
>>>

===>>>It says "Can't contact LDAP server" ..we should display a better
error message on console?

Actual results:
Error message says :: "Can't contact LDAP server"

Expected results:
we should display a better error message on console which indicates that RAM is
not enough.

git merge ticket47499
Updating 71151cf..1e035d1
Fast-forward
ldap/servers/slapd/back-ldbm/dblayer.c | 2 +-
ldap/servers/slapd/back-ldbm/ldbm_config.c | 50 +++++++++++++++----
.../servers/slapd/back-ldbm/ldbm_instance_config.c | 16 ++++++-
3 files changed, 55 insertions(+), 13 deletions(-)

git push origin master
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.51 KiB, done.
Total 9 (delta 7), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
71151cf..1e035d1 master -> master

commit 1e035d1
Author: Mark Reynolds mreynolds@redhat.com
Date: Tue Oct 8 17:16:23 2013 -0400

coverity fix:

git merge coverity
Updating 322fd79..7045c2e
Fast-forward
ldap/servers/slapd/back-ldbm/ldbm_config.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

git push origin master
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 802 bytes, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
322fd79..7045c2e master -> master

git log -1
commit 7045c2e
Author: Mark Reynolds mreynolds@redhat.com
Date: Mon Oct 14 11:28:26 2013 -0400

Metadata Update from @mreynolds:
- Issue assigned to mreynolds
- Issue set to the milestone: 1.3.3 - 10/13 (October)

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/836

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

10 months ago

Login to comment on this ticket.

Metadata