don't know exactly the reason, but here without this back-hdb suddenly starts crashings all times (since bdb_monitor_* stuff)

This commit is contained in:
Pierangelo Masarati 2006-09-26 08:43:01 +00:00
parent 18450addda
commit 067d6904c2
3 changed files with 17 additions and 7 deletions

View File

@ -31,7 +31,7 @@
# define SLAP_BDB_ALLOW_DIRTY_READ # define SLAP_BDB_ALLOW_DIRTY_READ
#endif #endif
#define bdb_cf_gen BDB_SYMBOL(cf_gen) #define bdb_cf_gen BDB_SYMBOL(cf_gen)
#define bdb_cf_cleanup BDB_SYMBOL(cf_cleanup) #define bdb_cf_cleanup BDB_SYMBOL(cf_cleanup)
#define bdb_checkpoint BDB_SYMBOL(checkpoint) #define bdb_checkpoint BDB_SYMBOL(checkpoint)
#define bdb_online_index BDB_SYMBOL(online_index) #define bdb_online_index BDB_SYMBOL(online_index)
@ -140,7 +140,7 @@ static ConfigOCs bdbocs[] = {
"olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ " "olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ "
"olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ " "olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ "
"olcDbMode $ olcDbSearchStack $ olcDbShmKey $ " "olcDbMode $ olcDbSearchStack $ olcDbShmKey $ "
" olcDbCacheFree ) )", "olcDbCacheFree ) )",
Cft_Database, bdbcfg }, Cft_Database, bdbcfg },
{ NULL, 0, NULL } { NULL, 0, NULL }
}; };
@ -333,7 +333,7 @@ bdb_cf_cleanup( ConfigArgs *c )
} }
static int static int
bdb_cf_gen(ConfigArgs *c) bdb_cf_gen( ConfigArgs *c )
{ {
struct bdb_info *bdb = c->be->be_private; struct bdb_info *bdb = c->be->be_private;
int rc; int rc;
@ -342,7 +342,7 @@ bdb_cf_gen(ConfigArgs *c)
rc = 0; rc = 0;
switch( c->type ) { switch( c->type ) {
case BDB_CHKPT: case BDB_CHKPT:
if (bdb->bi_txn_cp ) { if ( bdb->bi_txn_cp ) {
char buf[64]; char buf[64];
struct berval bv; struct berval bv;
bv.bv_len = sprintf( buf, "%d %d", bdb->bi_txn_cp_kbyte, bv.bv_len = sprintf( buf, "%d %d", bdb->bi_txn_cp_kbyte,
@ -363,8 +363,10 @@ bdb_cf_gen(ConfigArgs *c)
break; break;
case BDB_CONFIG: case BDB_CONFIG:
if (( slapMode&SLAP_SERVER_MODE ) && !( bdb->bi_flags&BDB_IS_OPEN ) if ( ( slapMode & SLAP_SERVER_MODE )
&& !bdb->bi_db_config ) { && !( bdb->bi_flags & BDB_IS_OPEN )
&& !bdb->bi_db_config )
{
char buf[SLAP_TEXT_BUFLEN]; char buf[SLAP_TEXT_BUFLEN];
FILE *f = fopen( bdb->bi_db_config_path, "r" ); FILE *f = fopen( bdb->bi_db_config_path, "r" );
struct berval bv; struct berval bv;
@ -442,7 +444,7 @@ bdb_cf_gen(ConfigArgs *c)
if ( bdb->bi_txn_cp_task ) { if ( bdb->bi_txn_cp_task ) {
struct re_s *re = bdb->bi_txn_cp_task; struct re_s *re = bdb->bi_txn_cp_task;
bdb->bi_txn_cp_task = NULL; bdb->bi_txn_cp_task = NULL;
if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re )) if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ) )
ldap_pvt_runqueue_stoptask( &slapd_rq, re ); ldap_pvt_runqueue_stoptask( &slapd_rq, re );
ldap_pvt_runqueue_remove( &slapd_rq, re ); ldap_pvt_runqueue_remove( &slapd_rq, re );
} }

View File

@ -198,6 +198,8 @@ bdb_monitor_free(
return SLAP_CB_CONTINUE; return SLAP_CB_CONTINUE;
} }
#define bdb_monitor_initialize BDB_SYMBOL(monitor_initialize)
/* /*
* call from within bdb_initialize() * call from within bdb_initialize()
*/ */

View File

@ -429,6 +429,12 @@ int bdb_modify_internal(
/* /*
* monitor.c * monitor.c
*/ */
#define bdb_monitor_db_init BDB_SYMBOL(monitor_db_init)
#define bdb_monitor_db_open BDB_SYMBOL(monitor_db_open)
#define bdb_monitor_db_close BDB_SYMBOL(monitor_db_close)
#define bdb_monitor_db_destroy BDB_SYMBOL(monitor_db_destroy)
int bdb_monitor_db_init( BackendDB *be ); int bdb_monitor_db_init( BackendDB *be );
int bdb_monitor_db_open( BackendDB *be ); int bdb_monitor_db_open( BackendDB *be );
int bdb_monitor_db_close( BackendDB *be ); int bdb_monitor_db_close( BackendDB *be );