[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: SSS/VLV implementation

You might want to read this thread from last week:

You really should be adding this feature via an overlay and not touching the back-bdb code at all.

As for the reader locks, there is a BDB locker ID associated with each thread. There is also a lock structure associated with each operation. Very likely you're seeing "lock is no longer valid" because the lock structure has been overwritten by an access to a subsequent entry. This is a bit tricky and unfortunately not handled very cleanly right now. Ideally, the details of back-bdb's internal locks should be invisible to the rest of the server but that's not how things work presently. You should take a look at how backend.c: backend_group() handles the op->o_private structure for an idea.

The normal -devel advice also applies - make sure you're working with CVS HEAD when writing new features. You should also look at overlays/syncprov.c or overlays/ppolicy.c (in CVS HEAD) for examples of how to implement new controls as part of an overlay.

Bertrand Croq wrote:


I have started an implementation of SSS/VLV in slapd (not really a
complete implementation... just so that Outlook can display the content
of the directory without using the search dialog). By now, the server
can parse the request controls. Now, I am modifying back-bdb (the only
backend I plan to use) so that search entries are stored instead of being
sent as soon as they are found.

By now, instead of calling send_search_entry(...), I call
store_vlv_entry(e) that should put the entry in a queue (sorted, if
possible) and set e to NULL; then, before calling send_search_result(), I
do some computations on the stored entries and send some of them using
send_search_entry(), with the corrects response controls.

Could you tell me how the reader lock is(are?) managed? As you can see, I set
e to NULL so that bdb_cache_return_entry_r() is not called before the
entry is sent to the client. Once the entry is sent, I call
bdb_cache_return_entry_r() but in the log I get this message (only

bdb(dc=raoul,dc=freeskop,dc=net): DB_LOCK->lock_put: Lock is no longer valid

Before going deeper in the reader lock management, I would like to know if there are some documentations or some threads on this list that I could read to learn about it?


 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support