Bug 54119 - Add a "reverse" cache option
Add a "reverse" cache option
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Dirk Wiesenthal
Julia Bremer
:
Depends on: 54068
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-22 15:06 CET by Dirk Wiesenthal
Modified: 2021-11-24 16:41 CET (History)
0 users

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2021-11-22 15:06:42 CET
The offline cache supports creating key/value pairs with a unique key as key and an arbitrary value.

Sometimes you need to ask for the value: Who has set this value? In order to do this efficiently, you want to reverse the database:

Store the value and point to a list of keys.

Example:
add-cache db1 entryUUID univentionMailHomeServer
=> 1. xxxx-... -> example.de
   2. yyyy-... -> example.de

add-cache db2 entryUUID univentionMailHomeServer --reverse
=> 1. example.de -> [xxxx-..., yyyy-...]
Comment 1 Dirk Wiesenthal univentionstaff 2021-11-23 02:15:44 CET
Package: univention-group-membership-cache
Version: 1.0.0-9A~4.4.0.202111230209
Branch: ucs_4.4-0
Scope: errata4.4-8

univention-group-membership-cache.yaml
bb83aeddcc88 | Bug #54119: YAML

univention-group-membership-cache (1.0.0-9)
a769c8b07581 | Bug #54119: Typo in list output

univention-group-membership-cache (1.0.0-8)
f5ca3ead3de3 | Bug #54119: Add reverse caches

ucs-test (9.0.7-79)
79227bc4e8c8 | Bug #54119: Test reverse cache

Added a new option:
/usr/share/univention-group-membership-cache/univention-ldap-cache add-cache ... --reverse

GDBM does not free disk space automatically, so we added a "reorganize()" call in several places. The reverse cache deletes and overwrites a lot of keys.

If the value (which is the key in the reverse cache) is used very often (say 100.000 times in an environment with > 100.000 objects), the cache is very inefficient when writing. This is because of the serialization that has to be made in GDBM. We may want to reconsider switching to LMDB at some point.
Comment 2 Julia Bremer univentionstaff 2021-11-24 10:54:31 CET
What I tested: 
Adding removing,functionality of reverse cache: OK
reorganizing cache: OK (every 1000 operations seems a little often to me?) 
test: OK (some issues with on samba4 machines I adjusted them accordingly)
permissions after cleanup: OK
works in office365 app: OK
yaml: OK
Verified