Bug 1916292

Summary: Indexing a single backend actually processes all configured backends.
Product: Red Hat Enterprise Linux 8 Reporter: Têko Mihinto <tmihinto>
Component: 389-ds-baseAssignee: Jamie Chapman <jachapma>
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: bsmejkal, jachapma, ldap-maint, mreynolds, sgouvern, tbordaz
Target Milestone: rcKeywords: Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-1.4-8060020211021200750.ce3e8c9c Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 13:43:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Têko Mihinto 2021-01-14 13:45:27 UTC
Description of problem:
While trying to index a given backend, the command output shows that all configured backends are being processed.
This can be problematic if one wants to reindex a small database and the command takes time because it runs also on existing larger backends.

Version-Release number of selected component (if applicable):
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.3 (Ootpa)
#
# rpm -qa | grep 389-ds-base
389-ds-base-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64
389-ds-base-libs-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64
#


How reproducible:
Always.

Steps to Reproduce:
1. Check the existing suffixes
#  dsconf -D "cn=Directory Manager" ldap://localhost:1389 backend suffix list 
Enter password for cn=Directory Manager on ldap://localhost:1389: 
dc=example,dc=com (userroot)
dc=navigation,dc=com (navigation)
o=test_numsubordinates (test)
#

2. Stop the server
# dsctl <INSTANCE> stop

3. Index a single backend:
# dsctl <INSTANCE> db2index userRoot
...
[14/Jan/2021:14:24:50.296524393 +0100] - INFO - bdb_pre_close - All database threads now stopped
db2index successful
#

4. Check the output of the command or the errors log.
One can see all backends being processed:
# grep "Reindexing complete" /var/log/dirsrv/slapd-<INSTANCE>/errors
[14/Jan/2021:14:24:46.741008633 +0100] - INFO - bdb_import_main - reindex userRoot: Reindexing complete.  Processed 160 entries in 1 seconds. (160.00 entries/sec)
[14/Jan/2021:14:24:47.939195147 +0100] - INFO - bdb_import_main - reindex Test: Reindexing complete.  Processed 14 entries in 0 seconds. (0.00 entries/sec)
[14/Jan/2021:14:24:50.269778456 +0100] - INFO - bdb_import_main - reindex navigation: Reindexing complete.  Processed 13 entries in 1 seconds. (13.00 entries/sec)
#

Actual results:
All backends are processed.

Expected results:
Only the specified backend should be processed.

Additional info:

Comment 9 bsmejkal 2021-11-04 10:08:23 UTC
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.6.8, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /usr/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-348.4.el8.x86_64-x86_64-with-redhat-8.6-Ootpa', 'Packages': {'pytest': '6.2.5', 'py': '1.10.0', 'pluggy': '1.0.0'}, 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1', 'libfaketime': '0.1.2', 'flaky': '3.7.0'}}
389-ds-base: 1.4.3.28-1.module+el8.6.0+13040+7da9aab8
nss: 3.67.0-6.el8_4
nspr: 4.32.0-1.el8_4
openldap: 2.4.46-18.el8
cyrus-sasl: 2.1.27-5.el8
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1, libfaketime-0.1.2, flaky-3.7.0
collected 1 item                                                                                                                                                                                                                             

dirsrvtests/tests/suites/basic/basic_test.py::test_basic_db2index PASSED                                                                                                                                                               [100%]

====================================================================================================== 1 passed, 14 warnings in 54.39s =======================================================================================================

Marking as VERIFIED.

Comment 11 errata-xmlrpc 2022-05-10 13:43:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (389-ds:1.4 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1815