bdb->bi_cache.c_leaves++;
rc = avl_insert( &ei->bei_parent->bei_kids, ei2, bdb_rdn_cmp,
avl_dup_error );
- assert( !rc );
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ if ( rc ) {
+ bdb->bi_dbenv->log_flush( bdb->bi_dbenv, NULL );
+ assert( !rc );
+ }
+#endif
#ifdef BDB_HIER
ei->bei_parent->bei_ckids++;
#endif
(ei.bei_nrdn.bv_val - ndn->bv_val);
bdb_cache_entryinfo_unlock( eip );
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, NULL, "Reading %s",
+ ei.bei_nrdn.bv_val );
+#endif
+
rc = bdb_dn2id( op, locker, &ei.bei_nrdn, &ei );
if (rc) {
bdb_cache_entryinfo_lock( eip );
return rc;
}
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, NULL, "Read got %s(%d)",
+ ei.bei_nrdn.bv_val, ei.bei_id );
+#endif
+
/* DN exists but needs to be added to cache */
ei.bei_nrdn.bv_len = len;
rc = bdb_entryinfo_add_internal( bdb, &ei, &ei2 );
+ Debug( LDAP_DEBUG_TRACE, "add_internal: \"%s\" %d\n",
+ ei.bei_nrdn.bv_val, ei.bei_id, 0 );
/* add_internal left eip and c_rwlock locked */
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_cache.c_rwlock );
if ( rc ) {
goto return_results;
}
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, lt2, "Starting delete %s(%d)",
+ e->e_nname.bv_val, e->e_id );
+#endif
+
/* Can't do it if we have kids */
rs->sr_err = bdb_cache_children( op, lt2, e );
if( rs->sr_err != DB_NOTFOUND ) {
p = NULL;
}
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, lt2, "Commit1 delete %s(%d)",
+ e->e_nname.bv_val, e->e_id );
+#endif
+
if ( TXN_COMMIT( lt2, 0 ) != 0 ) {
rs->sr_err = LDAP_OTHER;
rs->sr_text = "txn_commit(2) failed";
goto return_results;
}
} else {
+
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, ltid, "Cache delete %s(%d)",
+ e->e_nname.bv_val, e->e_id );
+#endif
+
rc = bdb_cache_delete( bdb, e, locker, &lock );
switch( rc ) {
case DB_LOCK_DEADLOCK:
ltid = NULL;
op->o_private = NULL;
+#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
+ bdb->bi_dbenv->log_printf( bdb->bi_dbenv, NULL, "Committed delete %s(%d)",
+ e->e_nname.bv_val, e->e_id );
+#endif
+
if( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_delete) ": txn_%s failed: %s (%d)\n",