Kurt Spanier [Fri, 5 Feb 1999 16:23:03 +0000 (16:23 +0000)]
Introduction of a new Berkeley DB version 2 (!) specific backend.
BEWARE: the backend will be compiled.
the backend will NOT be invoked, yet.
the backend CANNOT be invoked, yet, because it is NOT yet
integrated into the new initialization/startup environment
of the slapd server.
Kurt Spanier [Fri, 5 Feb 1999 13:20:57 +0000 (13:20 +0000)]
Fix braindead signal handling in linux kernal threads.
First version with waiting on int to become 0; should be implemented
via conditional variable...
Fix of typos.
First anchor for new bdb2 backend.
Kurt Zeilenga [Fri, 5 Feb 1999 09:03:47 +0000 (09:03 +0000)]
New Frontend->Backend Interface
Separates per backend type from per backend database initialization
and startup. Also supports per type / per backend shutdown.
New frontend startup/shutdown routines are also provided:
slap_init() slap_startup() slap_shutdown() slap_destroy()
New frontend->backend startup/shutdown is managed by:
backend_init() backend_startup() backend_shutdown backend_destroy
backend_init() now calls bi_init() to initial all function pointers
for the backend (excepting bi_init() which is now the only hardcoded
entry point). New entry points are detailed in slap.h struct
backend_info. backend_info is a per database type structure.
Besides the new startup/shutdown entry points, the new interface
also supports per backend type configuration options. One could have:
backend bdb2 (new Berkeley DB 2 backend)
bdb2_home /directory
database bdb2
...
*** This code is fairly experimental ***
*** Much cleanup and testing is still needed ***
see slap.h for details on struct backend_db and backend_info.
Kurt Zeilenga [Thu, 4 Feb 1999 18:00:50 +0000 (18:00 +0000)]
Fix dbcache/entry lock deadlock. If dbcache lock is held, it's
okay to read and write LDBM specific fields (state, refcnt,
LRU. The id field, though is read-only once set.
cache_find_entry_dn2id(), hence, does not require any entry locks.
cache_find_entry_id() must do a entry_rdwr_trylock() and back
off if busy.
Add new rdwr lock code with trylock() functionality.
Implement entry_rdwr_trylock().
Kurt Zeilenga [Thu, 4 Feb 1999 17:41:19 +0000 (17:41 +0000)]
Backout recent init/startup changes in preparation for new
frontend-backend interface.
Includes a number changes to share common routines between
database api types.
Kurt Zeilenga [Tue, 2 Feb 1999 02:46:18 +0000 (02:46 +0000)]
Fix idl_firstid to return NOID when !(nids > 1) instead of when (nids == 1)
Fix idl_nextid not to skip an ID if ID not in list.
Both of these should not occur if used correctly, but cheap insurance
against incorrect usage is welcomed.
Kurt Zeilenga [Sun, 31 Jan 1999 07:55:53 +0000 (07:55 +0000)]
Rewrite IDL block code to use simple array and accessor macros
instead of array with overlayed struct fields. (which is inherently
non-portable).
Change maxid check in insert to be greater than or equal instead
of equal.
Use SAFEMEMCPY.
Kurt Zeilenga [Thu, 28 Jan 1999 04:34:55 +0000 (04:34 +0000)]
Use -lldap_r instead of -lldap -lthread.
Likely broke things for non-posix threadings....
Update -lldap_r implementation to:
remove attribute support
hide thread detachment
provide concurrency accessors
provide initialization function
fix gethostby{addr,name}_r codes (not coverred by HAVE_REENTRANT_FUNCTIONS)
Update servers/libraries to use ldap_pvt_thread_ calls.
Cleanup server codes (no #ifdef HAVE_PTHREAD_THIS or _THATs)!
Removed -llthread
Kurt Zeilenga [Tue, 26 Jan 1999 20:55:54 +0000 (20:55 +0000)]
LDBM/back-ldbm locking reworked!
back-ldbm was using a cache specific lock to protect non-reentrant
database routines from being reenterred. This is inadequate.
Also, reentrant database systems calls were serialized unnecessarily.
Non-reentrant database calls must have a big_mutex. Implemented
this within -lldbm itself. library requires ldbm_initialize()
be called before any other ldbm call to initialize the big_mutex
and to do any other db specific initialization (ie: such as
required for DB2).
The dbc_mutex, dbc_cv, & dbc_readers fileds of dbcache are history.
The "reentrant_database" (REENTRANT_DATABASE) define is also axed.
Kurt Zeilenga [Tue, 26 Jan 1999 17:23:50 +0000 (17:23 +0000)]
Hide allocate of reentrant_database cond varible and reader count
behind REENTRANT_DATABASE. rename reentrant_database -> REENTRANT_DATABASE.
When REENTRANT_DATABASE is defined, the simple lock is replaced
with a simple reader/writer lock. This functionality should be removed
from back-ldbm to libldbm.
Kurt Zeilenga [Tue, 26 Jan 1999 05:22:58 +0000 (05:22 +0000)]
cache_set_state( cache, e, 0) cannot occur before lock on parent/root
is released. Some other thread may have cache locked but blocking
on parent. Must give up parent lock before acquiring cache lock.
Kurt Zeilenga [Tue, 26 Jan 1999 01:21:35 +0000 (01:21 +0000)]
Add lber_pvt.h with prototypes of lber_pvt_log_print{,f}.
Ripple name change through -llber & -lldap.
Update -lldif to use lber_pvt_log_printf() instead of Debug.
Kurt Zeilenga [Tue, 26 Jan 1999 00:27:51 +0000 (00:27 +0000)]
Add lber_log_print support to libldap.
Redefine Debug macro to call ldap_log_printf(NULL, lvl, fmt, ...)
Should replace each Debug statement with direct call to ldap_log_printf
passing LDAP session if available.
Kurt Zeilenga [Mon, 25 Jan 1999 02:30:58 +0000 (02:30 +0000)]
Move install.sh to install-sh. install.sh name may cause problems
with some 'make' programs that have a rule to create 'install' from
it there is no 'Makefile'. (per autoconf 2.12).
Kurt Zeilenga [Sat, 23 Jan 1999 19:33:53 +0000 (19:33 +0000)]
If dn2id returns ID but id2entry returns NULL, log it.
Assume entry was deleted from underneath the dn2entry call, hence
processing is same as if NOID had been returned.
Kurt Zeilenga [Sat, 23 Jan 1999 03:39:06 +0000 (03:39 +0000)]
Add LDAP_API_FEATURE_X_OPENLDAP to imply this implementation
has OpenLDAP extensions. (This may be defined on non-OpenLDAP
implmentations that implement features of our API).
The extensions implied by this flag are TBD.
Kurt Zeilenga [Fri, 22 Jan 1999 04:33:29 +0000 (04:33 +0000)]
Move libldap/strdup.c to string.c.
libldap/string.c will hold various string.h replacements.
Removed liblutil/strdup.c
Moved ldap_pvt_strtok to string.c.
Moved prototype of ldap_pvt_strtok to <ac/string.h>.
Added #define strtok_r ldap_pvt_strtok (if strtok_r doesn't exist).
Kurt Zeilenga [Fri, 22 Jan 1999 02:26:19 +0000 (02:26 +0000)]
Implement NEXTID chunking. Obtain IDs in chunks of size
SLAPD_NEXTID_CHUNK. Code protects NEXTID file to ensure
its equal to or greater than nextid. Updated on close
to actual nextid. next_id_save() could be called periodically
if desired. Default chunk size is 32. Define to 1 to disable
chunking.