int c_maxsize;
int c_cursize;
int c_minfree;
+ int c_eimax;
int c_eiused; /* EntryInfo's in use */
int c_leaves; /* EntryInfo leaf nodes */
int c_purging;
u_int32_t id;
};
+extern int __lock_getlocker(DB_LOCKTAB *lt, u_int32_t locker, int create, DB_LOCKER **ret);
+
#define CURSOR_SETLOCKER(cursor, id) \
__lock_getlocker(cursor->dbp->dbenv->lk_handle, id, 0, &cursor->locker)
#define CURSOR_GETLOCKER(cursor) cursor->locker->id
if ( slapMode & SLAP_TOOL_READONLY )
eimax = 0;
else
- eimax = bdb->bi_cache.c_maxsize * 4;
+ eimax = bdb->bi_cache.c_eimax;
/* Look for an unused entry to remove */
for ( elru = bdb->bi_cache.c_lruhead; elru; elru = elnext ) {
"( OLcfgDbAt:1.5 NAME 'olcDbDirtyRead' "
"DESC 'Allow reads of uncommitted data' "
"SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
+ { "dncachesize", "size", 2, 2, 0, ARG_INT|ARG_OFFSET,
+ (void *)offsetof(struct bdb_info, bi_cache.c_eimax),
+ "( OLcfgDbAt:1.12 NAME 'olcDbDNcacheSize' "
+ "DESC 'DN cache size' "
+ "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
{ "idlcachesize", "size", 2, 2, 0, ARG_INT|ARG_OFFSET,
(void *)offsetof(struct bdb_info,bi_idl_cache_max_size),
"( OLcfgDbAt:1.6 NAME 'olcDbIDLcacheSize' "
"olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ "
"olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ "
"olcDbMode $ olcDbSearchStack $ olcDbShmKey $ "
- "olcDbCacheFree ) )",
+ "olcDbCacheFree $ olcDbDNcacheSize ) )",
Cft_Database, bdbcfg },
{ NULL, 0, NULL }
};
flags | do_recover, bdb->bi_dbenv_mode );
if ( rc ) {
- /* Regular open faied, probably a missing shm environment.
+ /* Regular open failed, probably a missing shm environment.
* Start over, do a recovery.
*/
if ( !do_recover && bdb->bi_shm_key ) {
}
#endif
+ /* Default dncache to 2x entrycache */
+ if ( bdb->bi_cache.c_maxsize && !bdb->bi_cache.c_eimax ) {
+ bdb->bi_cache.c_eimax = bdb->bi_cache.c_maxsize * 2;
+ }
+
if ( bdb->bi_idl_cache_max_size ) {
bdb->bi_idl_tree = NULL;
bdb->bi_idl_cache_size = 0;
static ObjectClass *oc_olmBDBDatabase;
static AttributeDescription *ad_olmBDBEntryCache,
- *ad_olmBDBEntryInfo, *ad_olmBDBIDLCache,
+ *ad_olmBDBDNCache, *ad_olmBDBIDLCache,
*ad_olmDbDirectory;
#ifdef BDB_MONITOR_IDX
&ad_olmBDBEntryCache },
{ "( olmBDBAttributes:2 "
- "NAME ( 'olmBDBEntryInfo' ) "
- "DESC 'Number of items in EntryInfo Cache' "
+ "NAME ( 'olmBDBDNCache' ) "
+ "DESC 'Number of items in DN Cache' "
"SUP monitorCounter "
"NO-USER-MODIFICATION "
"USAGE dSAOperation )",
- &ad_olmBDBEntryInfo },
+ &ad_olmBDBDNCache },
{ "( olmBDBAttributes:3 "
"NAME ( 'olmBDBIDLCache' ) "
"SUP top AUXILIARY "
"MAY ( "
"olmBDBEntryCache "
- "$ olmBDBEntryInfo "
+ "$ olmBDBDNCache "
"$ olmBDBIDLCache "
"$ olmDbDirectory "
#ifdef BDB_MONITOR_IDX
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_cursize );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
- a = attr_find( e->e_attrs, ad_olmBDBEntryInfo );
+ a = attr_find( e->e_attrs, ad_olmBDBDNCache );
assert( a != NULL );
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_eiused );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
next->a_nvals = next->a_vals;
next = next->a_next;
- next->a_desc = ad_olmBDBEntryInfo;
+ next->a_desc = ad_olmBDBDNCache;
value_add_one( &next->a_vals, &bv );
next->a_nvals = next->a_vals;
next = next->a_next;