389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
212 stars 91 forks source link

vlv index keys inconsistencies #6028

Closed progier389 closed 9 months ago

progier389 commented 9 months ago

Issue Description When working on issue #6022 I discovered some inconsistencies that impact both bdb and lmdb

Package Version and Platform:

Steps to Reproduce Steps to reproduce the behavior:

  1. Go to 389-ds-base/dirsrvtests/tests/suites/vlv
  2. Edit regression_test.py and comment M2.restart() in test_vlv_cache_subdb_names
  3. Run ( DEBUGGING=1 pytest -x $PWD -k test_vlv_cache_subdb_names)
  4. Run dbscan -f '$DBDIR/userroot/vlv#vlvidx.db' > keys.1
  5. Run ( DEBUGGING=1 pytest -x $PWD -k 'test_bulk_import_when_the_backend_with_vlv_was_recreated or test_vlv_cache_subdb_names')
  6. Run dbscan -f '$DBDIR/userroot/vlv#vlvidx.db' > keys.2
  7. compare keys.1 and keys.2 See that keys.1 are the keys for the entries that matches (uid=) See that keys.2 are the keys for the entries that matches (|(uid=)(cn=*))

Expected results Should have keys matching the same entries

tbordaz commented 9 months ago

The patch itself looks good but I am very novice on vlv index/cache. Something surprising to me is that the description states inconsistency on both bdb and mdb but the PR is only fixing mdb.

progier389 commented 9 months ago

The reason is that PR #6026 is fixing the issue #6022 which only impact mdb. While testing that PR I hit this issue #6028 and used a work around (restarting the instance) so that the CI test is passing both on bdb and mdb. FYI I open this issue for tracking purpose but IMHO it is low priority as it is not a regression and no one has reported it.

progier389 commented 9 months ago

I made a mistake in my test (run the wrong testcase), the inconsistency exists only purely with lmdb There is a different problem on bdb (bdb_remove hangs in some case) but I will create a new issue for it.

progier389 commented 9 months ago

Inconsistency is due to the fact that when reindexing, vlv index sub db is not cleared before rebuilding the keys