Commit 93998532 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

ITS#4308 slapd-bdb/hdb cache sched fix

parent ccd520c0
......@@ -5,6 +5,7 @@ OpenLDAP 2.3.16 Engineering
Fixed slapd-monitor connection search crash (ITS#4300)
Flapd slapd cn=config bad ACL syntax modfy crash (ITS#4306)
Fixed slapd ACL/suffix configuration issue (ITS#4307)
Fixed slapd-bdb/hdb cache issue (ITS#4308)
Build environment
Replace sched_yield(2) on Linux with select(2) (ITS#3950)
Documentation
......
......@@ -150,6 +150,9 @@ struct bdb_db_info {
DB *bdi_db;
};
/* From ldap_rq.h */
struct re_s;
struct bdb_info {
DB_ENV *bi_dbenv;
......@@ -175,9 +178,9 @@ struct bdb_info {
int bi_txn_cp;
u_int32_t bi_txn_cp_min;
u_int32_t bi_txn_cp_kbyte;
void *bi_txn_cp_task;
void *bi_index_task;
void *bi_cache_task;
struct re_s *bi_txn_cp_task;
struct re_s *bi_index_task;
struct re_s *bi_cache_task;
int bi_lock_detect;
long bi_shm_key;
......
......@@ -643,11 +643,16 @@ bdb_cache_lru_add(
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
if ( bdb->bi_cache_task ) {
if ( !ldap_pvt_runqueue_isrunning( &slapd_rq,
bdb->bi_cache_task ))
bdb->bi_cache_task )) {
/* We want it to start right now */
bdb->bi_cache_task->interval.tv_sec = 0;
ldap_pvt_runqueue_resched( &slapd_rq, bdb->bi_cache_task,
0 );
/* But don't try to reschedule it while it's running */
bdb->bi_cache_task->interval.tv_sec = 3600;
}
} else {
bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 0,
bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 3600,
bdb_cache_lru_purge, bdb, "bdb_cache_lru_purge",
bdb->bi_dbenv_home );
}
......
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