Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-63887

nsslapd-mdb-max-dbs autotuning doesn't work properly

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-9.6
    • rhel-9.5
    • 389-ds-base
    • None
    • 389-ds-base-2.6.1-3.el9
    • No
    • Low
    • rhel-idm-ds
    • ssg_idm
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Hide

      Automated test passes with LMDB:

      dirsrvtests/tests/suites/config/config_test.py::test_lmdb_autotuned_maxdbs
      
      Show
      Automated test passes with LMDB: dirsrvtests/tests/suites/config/config_test.py::test_lmdb_autotuned_maxdbs
    • Pass
    • Automated
    • Unspecified Release Note Type - Unknown
    • None

      What were you trying to do that didn't work?

      When nsslapd-mdb-max-dbs is set to 0, DS autotunes number of sub-dbs, but it's not optimal, as it prevents creating new backends.

      What is the impact of this issue to you?

      Please provide the package NVR for which the bug is seen:

      389-ds-base-2.5.2-2.el9_5.x86_64

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1. Create a new instance with the MDB backend and default suffix
      2. Set autotuning for mdb-max-dbs and restart the server
        dsconf localhost backend config set --mdb-max-dbs 0
        dsctl localhost restart
        
      3. Check that MDB environment was created with max database instances=128 and check that 36 instances were consumed (1 by __DBNAMES, 4 by @long-entryrdn, ancestorid, id2entry, replication_changelog, and 31 by default indexes).
        dbscan -D mdb -S /var/lib/dirsrv/slapd-localhost/db/ | grep 'Database entries:'
        
      4. Create new backend and restart the server to recalculate the number of max dbs
        for i in $(seq 1 20); do dsconf localhost backend create --suffix=dc=test$i --be-name=test$i --create-suffix --create-entries; dsctl localhost restart; grep instances /var/log/dirsrv/slapd-localhost/errors | tail -n 1; dbscan -D mdb -S /var/lib/dirsrv/slapd-localhost/db/ | grep 'Database entries:'; done
        

      Expected results

      nsslapd-mdb-max-dbs is correctly recalculated and has enough free dbs to create new backend.

      Actual results

      It fails to add 4th backend, as it's not enough free entries (131-106=25, but at least 35 is required for a new backend).

      # for i in $(seq 1 20); do dsconf localhost backend create --suffix=dc=test$i --be-name=test$i --create-suffix --create
      -entries; dsctl localhost restart; grep instances /var/log/dirsrv/slapd-localhost/errors | tail -n 1; dbscan -D mdb -S /var/lib/dirsrv/slapd-lo
      calhost/db/ | grep 'Database entries:'; done
      The database was sucessfully created
      Instance "localhost" has been restarted
      [22/Oct/2024:07:32:49.915157748 -0400] - INFO - dbmdb_make_env - MDB environment created with max database instances=128.
      Database entries: 71
      free(): invalid pointer
      The database was sucessfully created
      Instance "localhost" has been restarted
      [22/Oct/2024:07:32:53.742132637 -0400] - INFO - dbmdb_make_env - MDB environment created with max database instances=131.
      Database entries: 106
      free(): invalid pointer
      Error: -1 - Can't contact LDAP server - [] - add_ext_s((dn: dc=test3
      dc: test3
      description: dc=test3
      objectclass: top
      objectclass: domain
      
      ,),{'serverctrls': None, 'clientctrls': None, 'escapehatch': 'i am sure'}) on instance localhost
      

              idm-ds-dev-bugs IdM DS Dev
              vashirov@redhat.com Viktor Ashirov
              IdM DS Dev IdM DS Dev
              Viktor Ashirov Viktor Ashirov
              Evgenia Martyniuk Evgenia Martyniuk
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: