Commit 7139d725 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Added patch from Stuart Lynne to SYNC cache to disk on write.

Ifdef'ed patch around LDBM_PESSIMISTIC as it causes slapd to sloowww down.
parent fd5226bf
......@@ -41,7 +41,11 @@ dn2id_add(
data.dptr = (char *) &id;
data.dsize = sizeof(ID);
#ifdef LDBM_PESSIMISTIC
rc = ldbm_cache_store( db, key, data, LDBM_INSERT | LDBM_SYNC );
#else
rc = ldbm_cache_store( db, key, data, LDBM_INSERT );
#endif
free( dn );
ldbm_cache_close( be, db );
......@@ -62,10 +66,10 @@ dn2id(
ID id;
Datum key, data;
Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
dn = strdup( dn );
dn_normalize_case( dn );
Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
/* first check the cache */
if ( (e = cache_find_entry_dn( &li->li_cache, dn )) != NULL ) {
......
......@@ -2,7 +2,6 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "slap.h"
#include "ldapconfig.h"
#include "back-ldbm.h"
......@@ -172,7 +171,11 @@ idl_store(
data.dptr = (char *) idl;
data.dsize = (2 + idl->b_nmax) * sizeof(ID);
#ifdef LDBM_PESSIMISTIC
rc = ldbm_cache_store( db, key, data, LDBM_REPLACE | LDBM_SYNC );
#else
rc = ldbm_cache_store( db, key, data, LDBM_REPLACE );
#endif
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */
return( rc );
......@@ -726,12 +729,9 @@ idl_notin(
if ( a == NULL ) {
return( NULL );
}
if ( b == NULL ) {
if ( b == NULL || ALLIDS( b )) {
return( idl_dup( a ) );
}
if ( ALLIDS( b ) ) {
return( NULL );
}
if ( ALLIDS( a ) ) {
n = idl_alloc( SLAPD_LDBM_MIN_MAXIDS );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment