Commit 3a5bde98 authored by Howard Chu's avatar Howard Chu
Browse files

Disable back-bdb native syncrepl support, enable syncprov overlay,

remove syncrepl stuff from Operation struct
parent 618cc562
This diff is collapsed.
......@@ -243,7 +243,7 @@ OL_ARG_ENABLE(sql,[ --enable-sql enable sql backend no|yes|mod],
dnl ----------------------------------------------------------------
dnl SLAPD Overlay Options
Overlays="chain denyop dyngroup lastmod ppolicy proxycache rwm \
refint unique"
refint syncprov unique"
AC_ARG_WITH(xxslapoverlays,[
SLAPD Overlay Options:])
......@@ -266,6 +266,8 @@ OL_ARG_ENABLE(refint,[ --enable-refint Referential Integrity overlay no|yes
no, [no yes mod])
OL_ARG_ENABLE(rwm,[ --enable-rwm Rewrite/Remap overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(syncprov,[ --enable-syncprov Syncrepl Provider overlay no|yes|mod],
yes, [no yes mod])
OL_ARG_ENABLE(unique,[ --enable-unique Attribute Uniqueness overlay no|yes|mod],
no, [no yes mod])
......@@ -2853,6 +2855,17 @@ if test "$ol_enable_rwm" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
fi
if test "$ol_enable_syncprov" != no ; then
BUILD_SYNCPROV=$ol_enable_syncprov
if test "$ol_enable_syncprov" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
else
MFLAG=SLAPD_MOD_STATIC
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_SYNCPROV,$MFLAG,[define for Syncrepl Provider overlay])
fi
if test "$ol_enable_unique" != no ; then
BUILD_UNIQUE=$ol_enable_unique
if test "$ol_enable_unique" = mod ; then
......@@ -2984,6 +2997,7 @@ dnl overlays
AC_SUBST(BUILD_PROXYCACHE)
AC_SUBST(BUILD_REFINT)
AC_SUBST(BUILD_RWM)
AC_SUBST(BUILD_SYNCPROV)
AC_SUBST(BUILD_UNIQUE)
AC_SUBST(BUILD_SLURPD)
......
......@@ -701,7 +701,7 @@
/* define if you have winsock2 */
#undef HAVE_WINSOCK2
/* define if you have epoll */
/* define if your system supports epoll */
#undef HAVE_EPOLL
/* define if sys_errlist is not declared in stdio.h or errno.h */
......@@ -1058,6 +1058,9 @@
/* define for Rewrite/Remap overlay */
#undef SLAPD_OVER_RWM
/* define for Syncrepl Provider overlay */
#undef SLAPD_OVER_SYNCPROV
/* define for Attribute Uniqueness overlay */
#undef SLAPD_OVER_UNIQUE
......
......@@ -2045,7 +2045,6 @@ aci_set_gather( SetCookie *cookie, struct berval *name, AttributeDescription *de
op2.ors_tlimit = SLAP_NO_LIMIT;
op2.ors_attrs = anlistp;
op2.ors_attrsonly = 0;
op2.o_sync_slog_size = -1;
cb.sc_private = &p;
......
......@@ -419,6 +419,7 @@ retry: /* transaction retry */
suffix_ei = BEI(e);
}
#ifdef BDB_PSEARCH
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {
bdb_cache_add( bdb, suffix_ei, ctxcsn_e,
......@@ -441,6 +442,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
rs->sr_text = "txn_commit failed";
......
......@@ -23,6 +23,8 @@
LDAP_BEGIN_DECL
#undef BDB_PSEARCH
#define DB_VERSION_FULL ((DB_VERSION_MAJOR << 24) | (DB_VERSION_MINOR << 16) | DB_VERSION_PATCH)
#define BDB_SUBENTRIES 1
......@@ -175,9 +177,11 @@ struct bdb_info {
ID bi_lastid;
ldap_pvt_thread_mutex_t bi_lastid_mutex;
#ifdef BDB_PSEARCH
LDAP_LIST_HEAD(pl, slap_op) bi_psearch_list;
ldap_pvt_thread_rdwr_t bi_pslist_rwlock;
LDAP_LIST_HEAD(se, slap_session_entry) bi_session_list;
#endif
int bi_idl_cache_max_size;
int bi_idl_cache_size;
Avlnode *bi_idl_tree;
......
......@@ -194,6 +194,7 @@ bdb_db_config(
}
if ( !( slapMode & SLAP_TOOL_MODE ) )
bdb->bi_idl_cache_max_size = atoi( argv[1] );
#ifdef BDB_PSEARCH
} else if ( strcasecmp( argv[0], "sessionlog" ) == 0 ) {
int se_id = 0, se_size = 0;
struct slap_session_entry *sent;
......@@ -234,7 +235,7 @@ bdb_db_config(
sent->se_id = se_id;
sent->se_size = se_size;
LDAP_LIST_INSERT_HEAD( &bdb->bi_session_list, sent, se_link );
#endif /* BDB_PSEARCH */
/* anything else */
} else {
return SLAP_CONF_UNKNOWN;
......
......@@ -377,6 +377,7 @@ retry: /* transaction retry */
goto return_results;
}
#ifdef BDB_PSEARCH
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_PREDELETE );
......@@ -390,6 +391,7 @@ retry: /* transaction retry */
}
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
#endif
/* delete from dn2id */
rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e );
......@@ -509,6 +511,7 @@ retry: /* transaction retry */
goto retry;
}
#ifdef BDB_PSEARCH
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {
bdb_cache_add( bdb, suffix_ei,
......@@ -543,6 +546,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
rs->sr_err = TXN_COMMIT( ltid, 0 );
}
......
......@@ -84,11 +84,13 @@ bdb_db_init( BackendDB *be )
bdb->bi_search_stack_depth = DEFAULT_SEARCH_STACK_DEPTH;
bdb->bi_search_stack = NULL;
#ifdef BDB_PSEARCH
LDAP_LIST_INIT (&bdb->bi_psearch_list);
ldap_pvt_thread_rdwr_init ( &bdb->bi_pslist_rwlock );
#endif
ldap_pvt_thread_mutex_init( &bdb->bi_database_mutex );
ldap_pvt_thread_mutex_init( &bdb->bi_lastid_mutex );
ldap_pvt_thread_rdwr_init ( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_mutex_init( &bdb->bi_cache.lru_mutex );
ldap_pvt_thread_mutex_init( &bdb->bi_cache.c_dntree.bei_kids_mutex );
ldap_pvt_thread_rdwr_init ( &bdb->bi_cache.c_rwlock );
......@@ -455,7 +457,6 @@ bdb_db_destroy( BackendDB *be )
ldap_pvt_thread_rdwr_destroy ( &bdb->bi_cache.c_rwlock );
ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.lru_mutex );
ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.c_dntree.bei_kids_mutex );
ldap_pvt_thread_rdwr_destroy ( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_mutex_destroy( &bdb->bi_lastid_mutex );
ldap_pvt_thread_mutex_destroy( &bdb->bi_database_mutex );
if ( bdb->bi_idl_cache_max_size ) {
......@@ -463,6 +464,8 @@ bdb_db_destroy( BackendDB *be )
ldap_pvt_thread_mutex_destroy( &bdb->bi_idl_tree_lrulock );
}
#ifdef BDB_PSEARCH
ldap_pvt_thread_rdwr_destroy ( &bdb->bi_pslist_rwlock );
ps = LDAP_LIST_FIRST( &bdb->bi_psearch_list );
if ( ps ) {
......@@ -521,6 +524,7 @@ bdb_db_destroy( BackendDB *be )
slap_sl_mem_destroy( NULL, saved_tmpmemctx );
}
}
#endif
ch_free( bdb );
be->be_private = NULL;
......@@ -626,8 +630,10 @@ bdb_back_initialize(
bi->bi_op_unbind = 0;
#if 0
bi->bi_op_abandon = bdb_abandon;
bi->bi_op_cancel = bdb_cancel;
#endif
bi->bi_extended = bdb_extended;
......
......@@ -307,6 +307,7 @@ retry: /* transaction retry */
Debug(LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_modify) ": retrying...\n", 0, 0, 0);
#ifdef BDB_PSEARCH
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
LDAP_LIST_REMOVE ( pm_list, ps_link );
......@@ -314,6 +315,7 @@ retry: /* transaction retry */
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
#endif
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
......@@ -445,6 +447,7 @@ retry: /* transaction retry */
goto return_results;
}
#ifdef BDB_PSEARCH
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
......@@ -461,6 +464,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
if( op->o_preread ) {
if( preread_ctrl == NULL ) {
......@@ -575,6 +579,7 @@ retry: /* transaction retry */
}
dummy.e_attrs = NULL;
#ifdef BDB_PSEARCH
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {
bdb_cache_add( bdb, suffix_ei, ctxcsn_e,
......@@ -613,6 +618,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
rs->sr_err = TXN_COMMIT( ltid, 0 );
}
......@@ -653,6 +659,7 @@ return_results:
done:
if( ltid != NULL ) {
#ifdef BDB_PSEARCH
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
LDAP_LIST_REMOVE ( pm_list, ps_link );
......@@ -660,6 +667,7 @@ done:
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
#endif
TXN_ABORT( ltid );
op->o_private = NULL;
}
......
......@@ -100,6 +100,7 @@ retry: /* transaction retry */
}
Debug( LDAP_DEBUG_TRACE, "==>" LDAP_XSTRING(bdb_modrdn)
": retrying...\n", 0, 0, 0 );
#ifdef BDB_PSEARCH
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
LDAP_LIST_REMOVE ( pm_list, ps_link );
......@@ -107,6 +108,7 @@ retry: /* transaction retry */
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
#endif
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
......@@ -718,6 +720,7 @@ retry: /* transaction retry */
dummy.e_attrs = e->e_attrs;
#ifdef BDB_PSEARCH
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
......@@ -731,6 +734,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
/* modify entry */
......@@ -847,6 +851,7 @@ retry: /* transaction retry */
new_dn.bv_val = NULL;
new_ndn.bv_val = NULL;
#ifdef BDB_PSEARCH
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {
bdb_cache_add( bdb, suffix_ei, ctxcsn_e,
......@@ -885,6 +890,7 @@ retry: /* transaction retry */
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
#endif
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
rs->sr_text = "txn_commit failed";
......@@ -972,6 +978,7 @@ done:
}
if( ltid != NULL ) {
#ifdef BDB_PSEARCH
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
LDAP_LIST_REMOVE ( pm_list, ps_link );
......@@ -979,6 +986,7 @@ done:
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
#endif
TXN_ABORT( ltid );
op->o_private = NULL;
}
......
......@@ -302,6 +302,8 @@ sameido:
return rs->sr_err;
}
#ifdef BDB_PSEARCH
#define is_sync_protocol(op) \
((op)->o_sync_mode & SLAP_SYNC_REFRESH_AND_PERSIST)
......@@ -595,6 +597,12 @@ int bdb_psearch( Operation *op, SlapReply *rs, Operation *sop,
return LDAP_OTHER;
}
}
#else
int bdb_search( Operation *op, SlapReply *rs )
{
return bdb_do_search( op, rs, op, NULL, 0 );
}
#endif
/* For persistent searches, op is the currently executing operation,
* sop is the persistent search. For regular searches, sop = op.
......@@ -617,6 +625,12 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
ID lastid = NOID;
AttributeName *attrs;
u_int32_t locker = 0;
DB_LOCK lock;
struct bdb_op_info *opinfo = NULL;
DB_TXN *ltid = NULL;
#ifdef BDB_PSEARCH
Filter contextcsnand, contextcsnle, cookief, csnfnot,
csnfeq, csnfand, csnfge;
AttributeAssertion aa_ge, aa_eq, aa_le;
......@@ -630,8 +644,6 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
AttributeName null_attr;
int no_sync_state_change = 0;
u_int32_t locker = 0;
DB_LOCK lock;
Operation *ps_list;
int sync_send_present_mode = 1;
......@@ -644,14 +656,14 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
BerVarray syncUUID_set = NULL;
int syncUUID_set_cnt = 0;
struct bdb_op_info *opinfo = NULL;
DB_TXN *ltid = NULL;
#endif
Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(bdb_search) "\n", 0, 0, 0);
attrs = sop->oq_search.rs_attrs;
opinfo = (struct bdb_op_info *) op->o_private;
#ifdef BDB_PSEARCH
if ( !IS_POST_SEARCH && !IS_PSEARCH &&
sop->o_sync_mode & SLAP_SYNC_REFRESH_AND_PERSIST ) {
struct slap_session_entry *sent;
......@@ -732,9 +744,11 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
attrs[0].an_oc_exclude = 0;
BER_BVZERO( &attrs[0].an_name );
}
#endif
manageDSAit = get_manageDSAit( sop );
#ifdef BDB_PSEARCH
/* Sync control overrides manageDSAit */
if ( !IS_PSEARCH && sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
if ( manageDSAit == SLAP_CONTROL_NONE ) {
......@@ -745,6 +759,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
manageDSAit = SLAP_CONTROL_CRITICAL;
}
}
#endif
if ( opinfo && opinfo->boi_txn ) {
ltid = opinfo->boi_txn;
......@@ -761,6 +776,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
}
}
#ifdef BDB_PSEARCH
if ( IS_POST_SEARCH ) {
cursor = 0;
candidates[0] = 1;
......@@ -768,6 +784,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
search_context_csn = ber_dupbv( NULL, &op->o_sync_csn );
goto loop_start;
}
#endif
if ( sop->o_req_ndn.bv_len == 0 ) {
/* DIT root special case */
......@@ -918,6 +935,7 @@ dn2entry_retry:
}
e = NULL;
#ifdef BDB_PSEARCH
if ( !IS_PSEARCH ) {
rs->sr_err = bdb_get_commit_csn( sop, rs, &search_context_csn,
locker, &ctxcsn_lock );
......@@ -939,6 +957,7 @@ dn2entry_retry:
} else {
search_context_csn = ber_dupbv( NULL, &op->o_sync_csn );
}
#endif
/* select candidates */
if ( sop->oq_search.rs_scope == LDAP_SCOPE_BASE ) {
......@@ -951,13 +970,16 @@ dn2entry_retry:
locker, candidates, scopes );
}
#ifdef BDB_PSEARCH
if ( !IS_PSEARCH && sop->o_sync_mode != SLAP_SYNC_NONE ) {
bdb_cache_entry_db_unlock( bdb->bi_dbenv, &ctxcsn_lock );
}
#endif
/* start cursor at beginning of candidates.
*/
cursor = 0;
#ifdef BDB_PSEARCH
if (IS_PSEARCH) {
if ( !BDB_IDL_IS_RANGE( candidates ) ) {
cursor = bdb_idl_search( candidates, ps_e->e_id );
......@@ -974,6 +996,7 @@ dn2entry_retry:
candidates[0] = 1;
candidates[1] = ps_e->e_id;
}
#endif
if ( candidates[0] == 0 ) {
Debug( LDAP_DEBUG_TRACE,
......@@ -1041,6 +1064,7 @@ dn2entry_retry:
goto loop_begin;
}
#ifdef BDB_PSEARCH
if (( sop->o_sync_mode & SLAP_SYNC_REFRESH ) || IS_PSEARCH ) {
int match;
......@@ -1103,18 +1127,23 @@ dn2entry_retry:
csnfge.f_next = sop->oq_search.rs_filter;
}
}
#endif
loop_start:
for ( id = bdb_idl_first( candidates, &cursor );
id != NOID && !no_sync_state_change;
id = bdb_idl_next( candidates, &cursor ) )
id != NOID
#ifdef BDB_PSEARCH
&& !no_sync_state_change
#endif
; id = bdb_idl_next( candidates, &cursor ) )
{
int scopeok = 0;
ID* idhole = NULL;
loop_begin:
#ifdef BDB_PSEARCH
if ( !IS_POST_SEARCH ) {
idhole = (ID*) avl_find( sop->o_psearch_finished,
(caddr_t)&id, bdb_pfid_cmp );
......@@ -1179,6 +1208,13 @@ loop_begin:
rs->sr_err = LDAP_SUCCESS;
goto done;
}
#else
/* check for abandon */
if ( sop->o_abandon ) {
rs->sr_err = LDAP_SUCCESS;
goto done;
}
#endif
/* check time limit */
if ( sop->ors_tlimit != SLAP_NO_LIMIT
......@@ -1191,7 +1227,9 @@ loop_begin:
goto done;
}
#ifdef BDB_PSEARCH
if (!IS_PSEARCH) {
#endif
id2entry_retry:
/* get the entry with reader lock */
ei = NULL;
......@@ -1216,11 +1254,14 @@ id2entry_retry:
}
if ( e == NULL ) {
#ifdef BDB_PSEARCH
if ( IS_POST_SEARCH ) {
/* send LDAP_SYNC_DELETE */
rs->sr_entry = e = ps_e;
goto post_search_no_entry;
} else if( !BDB_IDL_IS_RANGE(candidates) ) {
} else
#endif
if( !BDB_IDL_IS_RANGE(candidates) ) {
/* only complain for non-range IDLs */
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_search)
......@@ -1230,9 +1271,11 @@ id2entry_retry:
goto loop_continue;
}
#ifdef BDB_PSEARCH
} else {
e = ps_e;
}
#endif
rs->sr_entry = e;
......@@ -1331,7 +1374,12 @@ id2entry_retry:
}
/* Not in scope, ignore it */
if ( !IS_POST_SEARCH && !scopeok ) {
#ifdef BDB_PSEARCH
if ( !IS_POST_SEARCH && !scopeok )
#else
if ( !scopeok )
#endif
{
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_search)
": %ld scope not okay\n",
......@@ -1366,6 +1414,9 @@ id2entry_retry:
}
/* if it matches the filter and scope, send it */
#ifndef BDB_PSEARCH
rs->sr_err = test_filter( sop, rs->sr_entry, sop->oq_search.rs_filter );
#else
if (IS_PSEARCH) {
if (ps_type != LDAP_PSEARCH_BY_SCOPEOUT) {
rs->sr_err = test_filter( sop, rs->sr_entry, &cookief );
......@@ -1409,16 +1460,23 @@ id2entry_retry:
}
}
}
#endif
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
if ( --sop->ors_slimit == -1 &&
sop->o_sync_slog_size == -1 )
{
if ( --sop->ors_slimit == -1
#ifdef BDB_PSEARCH
&& sop->o_sync_slog_size == -1
#endif
) {
#ifdef BDB_PSEARCH
if (!IS_PSEARCH) {
#endif
bdb_cache_return_entry_r( bdb->bi_dbenv,
&bdb->bi_cache, e, &lock );
#ifdef BDB_PSEARCH
}
#endif
e = NULL;
rs->sr_entry = NULL;
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
......@@ -1439,7 +1497,7 @@ id2entry_retry:
if (e) {
/* safe default */
int result = -1;
#ifdef BDB_PSEARCH
if (IS_PSEARCH || IS_POST_SEARCH) {
int premodify_found = 0;
......@@ -1592,14 +1650,17 @@ post_search_no_entry:
}
} else {
#endif
rs->sr_attrs = sop->oq_search.rs_attrs;
rs->sr_operational_attrs = NULL;
rs->sr_ctrls = NULL;
rs->sr_flags = 0;
rs->sr_err = LDAP_SUCCESS;
result = send_search_entry( sop, rs );
#ifdef BDB_PSEARCH
}
}
#endif
switch (result) {
case 0: /* entry sent ok */
......@@ -1607,10 +1668,14 @@ post_search_no_entry:
case 1: /* entry not sent */
break;
case -1: /* connection closed */
#ifdef BDB_PSEARCH
if (!IS_PSEARCH) {
#endif
bdb_cache_return_entry_r(bdb->bi_dbenv,
&bdb->bi_cache, e, &lock);
#ifdef BDB_PSEARCH
}
#endif
e = NULL;