Finish proxy cache cleanup and API porting (on behalf of Apurva Kumar)

This commit is contained in:
Pierangelo Masarati 2003-05-24 17:38:04 +00:00
parent 89f7ffc9de
commit 6180bcbf51
6 changed files with 258 additions and 138 deletions

View file

@ -90,7 +90,7 @@ meta_back_cache_config(
}
cm->num_entries_limit = atoi( argv[4] );
cm->consistency_cycle_time = atoi( argv[5] );
cm->cc_period = atoi( argv[5] );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"Total # of attribute sets to be cached = %d\n",

View file

@ -44,7 +44,7 @@ merge_func (
SlapReply *rs
);
void
static void
add_func (
Operation *op,
SlapReply *rs
@ -62,6 +62,15 @@ get_size_func (
SlapReply *rs
);
static int
null_response (
Operation *op,
SlapReply *rs
);
static int
normalize_values( Attribute* attr );
struct entry_info {
int size_init;
int size_final;
@ -73,6 +82,7 @@ struct entry_info {
Backend* glue_be;
};
int
get_entry_size(
Entry* e,
@ -112,12 +122,15 @@ add_merge_func( Operation *op, SlapReply *rs )
{
switch ( rs->sr_type ) {
case REP_SEARCH:
add_func( op, rs );
merge_func( op, rs );
break;
case REP_RESULT:
merge_func( op, rs );
add_func( op, rs );
break;
default:
assert( 0 );
}
return 0;
}
@ -133,10 +146,14 @@ merge_entry(
struct berval normdn;
struct berval prettydn;
SlapReply sreply = {REP_RESULT};
Operation op_tmp = *op;
slap_callback cb = { add_merge_func, NULL };
Filter* filter = str2filter( bv_queryid_any.bv_val );
sreply.sr_entry = NULL;
sreply.sr_nentries = 0;
dnPrettyNormal(0, &rs->sr_entry->e_name, &prettydn, &normdn,
op->o_tmpmemctx);
@ -173,7 +190,7 @@ merge_entry(
op_tmp.ors_attrs = NULL;
op_tmp.ors_attrsonly = 0;
op->o_bd->be_search( &op_tmp, rs );
op->o_bd->be_search( &op_tmp, &sreply );
result->type = info.err;
if ( result->type == SUCCESS )
result->rc = info.added;
@ -207,6 +224,8 @@ merge_func (
AttributeDescription *a_new_desc;
const char *text = NULL;
Operation op_tmp = *op;
SlapReply sreply = {REP_RESULT};
SlapReply sreply1 = {REP_RESULT};
info->err = SUCCESS;
@ -221,12 +240,13 @@ merge_func (
mod->sml_op = LDAP_MOD_REPLACE;
ber_dupbv(&mod->sml_type, &a_new_desc->ad_cname);
for (count = 0; a_new->a_vals[count].bv_val; count++)
for ( count = 0; a_new->a_vals[count].bv_val; count++ )
;
mod->sml_bvalues = (struct berval*) malloc(
(count+1) * sizeof( struct berval) );
for (i=0; i < count; i++) {
for ( i = 0; i < count; i++ ) {
ber_dupbv(mod->sml_bvalues+i, a_new->a_vals+i);
}
@ -258,10 +278,12 @@ merge_func (
op_tmp.o_req_ndn = entry->e_nname;
op_tmp.orm_modlist = modhead;
if (be->be_modify(op, rs ) != 0 ) {
op_tmp.o_callback->sc_response = null_response;
/* FIXME: &op_tmp ??? */
if (be->be_modify(op, &sreply ) != 0 ) {
/* FIXME: cleanup ? */
info->err = MERGE_ERR;
return 0;
goto cleanup;
}
/* compute the size of the entry */
@ -275,15 +297,23 @@ merge_func (
op_tmp.ors_filterstr = bv_queryid_any;
op_tmp.ors_attrs = NULL;
op_tmp.ors_attrsonly = 0;
if (be->be_search( &op_tmp, rs ) != 0) {
sreply1.sr_entry = NULL;
sreply1.sr_nentries = 0;
if (be->be_search( &op_tmp, &sreply1 ) != 0) {
info->err = GET_SIZE_ERR;
}
cleanup:;
if ( modhead != NULL) {
slap_mods_free( modhead );
}
return 0;
}
void
static void
add_func (
Operation *op,
SlapReply *rs
@ -295,7 +325,9 @@ add_func (
Backend *be;
BerVarray value_array;
Entry *e;
Attribute *a;
Attribute *a, *attr;
int i,j;
SlapReply sreply = {REP_RESULT};
struct timeval time; /* time */
long timediff; /* time */
@ -306,9 +338,11 @@ add_func (
* new entry, construct an entry with
* the projected attributes
*/
if (rs->sr_nentries)
return;
if (rs->sr_nentries) {
return;
}
op_tmp.o_callback->sc_response = null_response;
be = select_backend(&entry->e_nname, 0, 0);
e = (Entry*)malloc(sizeof(Entry));
@ -332,12 +366,19 @@ add_func (
a->a_next = entry->e_attrs;
entry->e_attrs = NULL;
info->size_final = get_entry_size(e, 0, NULL);
for ( attr = e->e_attrs; attr; attr = attr->a_next ) {
if ( normalize_values( attr ) ) {
info->err = MERGE_ERR;
return;
}
}
info->size_final = get_entry_size( e, 0, NULL );
op_tmp.o_bd = be;
op_tmp.ora_e = e;
if ( be->be_add( &op_tmp, rs ) == 0 ) {
if ( be->be_add( &op_tmp, &sreply ) == 0 ) {
info->added = 1;
be_entry_release_w( &op_tmp, e );
} else {
@ -393,4 +434,62 @@ get_size_func (
return 0;
}
static int
null_response (
Operation *op,
SlapReply *rs )
{
return 0;
}
static int
normalize_values( Attribute* attr )
{
int nvals, rc, i;
if (attr->a_vals == NULL) {
attr->a_nvals = NULL;
return 0;
}
for ( nvals = 0; attr->a_vals[nvals].bv_val; nvals++ )
;
attr->a_nvals = (struct berval*)ch_malloc((nvals+1)*sizeof(struct berval));
if ( attr->a_desc->ad_type->sat_equality &&
attr->a_desc->ad_type->sat_equality->smr_normalize )
{
for ( i = 0; i < nvals; i++ ) {
rc = attr->a_desc->ad_type->sat_equality->smr_normalize(
0,
attr->a_desc->ad_type->sat_syntax,
attr->a_desc->ad_type->sat_equality,
&attr->a_vals[i], &attr->a_nvals[i], NULL );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1,
"Error in normalizing attribute %s value %d (%d)\n",
attr->a_desc->ad_cname.bv_val, i, rc );
#else
Debug( LDAP_DEBUG_ANY,
"Error in normalizing attribute %s value %d (%d)\n",
attr->a_desc->ad_cname.bv_val, i, rc );
#endif
return rc;
}
}
} else {
for ( i = 0; i < nvals; i++ ) {
ber_dupbv( &attr->a_nvals[i], &attr->a_vals[i] );
}
}
attr->a_nvals[i].bv_val = NULL;
attr->a_nvals[i].bv_len = 0;
return LDAP_SUCCESS;
}
#endif /* LDAP_CACHING */

View file

@ -60,11 +60,12 @@ remove_query_data (
char filter_str[64];
Operation op_tmp = *op;
Filter *filter;
struct timeval time_in;
struct timeval time_out;
long timediff;
SlapReply sreply = {REP_RESULT};
slap_callback cb = { remove_func, NULL };
sreply.sr_entry = NULL;
sreply.sr_nentries = 0;
snprintf(filter_str, sizeof(filter_str), "(queryid=%s)",
query_uuid->bv_val);
filter = str2filter(filter_str);
@ -93,7 +94,7 @@ remove_query_data (
op_tmp.ors_attrs = NULL;
op_tmp.ors_attrsonly = 0;
op->o_bd->be_search( &op_tmp, rs );
op->o_bd->be_search( &op_tmp, &sreply );
result->type = info.err;
result->rc = info.deleted;
@ -110,14 +111,17 @@ remove_func (
struct query_info *info = op->o_callback->sc_private;
int count = 0;
int size;
struct timeval time_in;
struct timeval time_out;
long timediff;
Modifications *mod;
Attribute *attr;
Operation op_tmp = *op;
SlapReply sreply = {REP_RESULT};
if (rs->sr_type == REP_RESULT)
return 0;
size = get_entry_size(rs->sr_entry, 0, NULL);
for (attr = rs->sr_entry->e_attrs; attr!= NULL; attr = attr->a_next) {
@ -177,7 +181,7 @@ remove_func (
op_tmp.o_req_ndn = rs->sr_entry->e_nname;
op_tmp.orm_modlist = mod;
if (op->o_bd->be_modify( &op_tmp, rs )) {
if (op->o_bd->be_modify( &op_tmp, &sreply )) {
info->err = REMOVE_ERR;
}

View file

@ -203,11 +203,9 @@ is_temp_answerable(
int template_id
);
static void
static void*
consistency_check(
Operation *op,
SlapReply *rs,
Backend *glue_be
void *op
);
static int
@ -216,6 +214,7 @@ cache_back_sentry(
SlapReply *rs
);
int
meta_back_cache_search(
Operation *op,
@ -296,6 +295,7 @@ meta_back_cache_search(
attrs[ count ].an_name.bv_len = 0;
}
result->type = SUCCESS;
result->rc = 0;
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
@ -307,6 +307,13 @@ meta_back_cache_search(
#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
ldap_pvt_thread_mutex_lock(&cm->cc_mutex);
if (!cm->cc_thread_started) {
cm->cc_thread_started = 1;
ldap_pvt_thread_create(&(cm->cc_thread), 1, consistency_check, (void*)op);
}
ldap_pvt_thread_mutex_unlock(&cm->cc_mutex);
filter2template(filter, &tempstr, &filter_attrs, &fattr_cnt, result);
if (result->type != SUCCESS)
goto Catch;
@ -386,8 +393,8 @@ meta_back_cache_search(
op_tmp.o_caching_on = 1;
op_tmp.o_callback = &cb;
li->glue_be->be_search(op, rs);
ber_memfree( ncachebase.bv_val );
li->glue_be->be_search(&op_tmp, rs);
free( ncachebase.bv_val );
if ( cachebase.bv_val != op->o_req_dn.bv_val ) {
/* free only if rewritten */
free( cachebase.bv_val );
@ -395,6 +402,8 @@ meta_back_cache_search(
ldap_pvt_thread_rdwr_runlock(&qm->templates[i].t_rwlock);
} else {
Operation op_tmp = *op;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "QUERY NOT ANSWERABLE\n",
0, 0, 0 );
@ -402,14 +411,14 @@ meta_back_cache_search(
Debug( LDAP_DEBUG_ANY, "QUERY NOT ANSWERABLE\n", 0, 0, 0 );
#endif /* !NEW_LOGGING */
if ( op->ors_scope == LDAP_SCOPE_BASE ) {
if ( op_tmp.ors_scope == LDAP_SCOPE_BASE ) {
op_type = META_OP_REQUIRE_SINGLE;
} else {
op_type = META_OP_ALLOW_MULTIPLE;
}
lc = metaConnect(op, rs, op_type,
&op->o_req_ndn, result);
lc = metaConnect(&op_tmp, rs, op_type,
&op_tmp.o_req_ndn, result);
if (result->type != SUCCESS)
goto Catch;
@ -453,7 +462,6 @@ meta_back_cache_search(
/*
* Inits searches
*/
for ( i = 0, lsc = lc->conns; !META_LAST(lsc); ++i, ++lsc ) {
char *realbase = ( char * )op->o_req_dn.bv_val;
int realscope = op->ors_scope;
@ -633,7 +641,7 @@ meta_back_cache_search(
++candidates;
}
num_entries = handleLdapResult(lc, op, rs, msgid,
num_entries = handleLdapResult(lc, &op_tmp, rs, msgid,
op->o_bd, attrs,
op->ors_attrsonly, candidates,
cacheable, &entry_array,
@ -642,7 +650,6 @@ meta_back_cache_search(
if (result->type != SUCCESS)
goto Catch;
if (cacheable && (num_entries <= curr_limit)) {
Operation op_tmp = *op;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
@ -757,13 +764,6 @@ Catch:;
break;
}
ldap_pvt_thread_mutex_lock(&cm->consistency_mutex);
curr_time = slap_get_time();
if (curr_time - cm->consistency_time > cm->consistency_cycle_time) {
cm->consistency_time = curr_time;
consistency_check(op, rs, li->glue_be);
}
ldap_pvt_thread_mutex_unlock(&cm->consistency_mutex);
if ( msgid ) {
ch_free( msgid );
@ -892,6 +892,7 @@ meta_create_entry (
attr->a_flags = 0;
attr->a_next = 0;
attr->a_desc = NULL;
attr->a_nvals = NULL;
if ( slap_bv2ad( &mapped, &attr->a_desc, &text ) != LDAP_SUCCESS) {
if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text )
!= LDAP_SUCCESS) {
@ -1011,7 +1012,7 @@ is_one_level_rdn(
static struct metaconn*
metaConnect(
Operation* op,
Operation *op,
SlapReply *rs,
int op_type,
struct berval *nbase,
@ -1034,11 +1035,8 @@ add_filter_attrs(
AttributeName* attrs,
AttributeName* filter_attrs )
{
struct berval all_user = { sizeof(LDAP_ALL_USER_ATTRIBUTES) -1,
LDAP_ALL_USER_ATTRIBUTES };
struct berval all_op = { sizeof(LDAP_ALL_OPERATIONAL_ATTRIBUTES) -1,
LDAP_ALL_OPERATIONAL_ATTRIBUTES};
struct berval all_user = BER_BVC(LDAP_ALL_USER_ATTRIBUTES);
struct berval all_op = BER_BVC(LDAP_ALL_OPERATIONAL_ATTRIBUTES);
int alluser = 0;
int allop = 0;
@ -1145,8 +1143,10 @@ handleLdapResult(
if ((entry = get_result_entry(be, lc, lsc,
msgid, i, &tv, result))) {
rs->sr_entry = entry;
rs->sr_attrs = op->ors_attrs;
send_search_entry( op, rs );
rs->sr_entry = NULL;
rs->sr_attrs = NULL;
if ((cacheable) &&
(num_entries < curr_limit)) {
rewriteSession( li->rwinfo,
@ -1637,10 +1637,15 @@ is_temp_answerable(
return 0;
}
static void
consistency_check(Operation *op, SlapReply *rs, Backend* glue_be)
static void*
consistency_check(void* operation)
{
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
Operation* op_tmp = (Operation*)operation;
Operation op = *op_tmp;
SlapReply rs = {REP_RESULT};
struct metainfo *li = ( struct metainfo * )op.o_bd->be_private;
cache_manager* cm = li->cm;
query_manager* qm = cm->qm;
CachedQuery* query, *query_prev;
@ -1649,87 +1654,88 @@ consistency_check(Operation *op, SlapReply *rs, Backend* glue_be)
struct exception result;
int i, return_val;
QueryTemplate* templ;
Backend *be = op->o_bd;
op->o_bd = glue_be;
op.o_bd = li->glue_be;
for (i=0; qm->templates[i].querystr; i++) {
templ = qm->templates + i;
query = templ->query_last;
curr_time = slap_get_time();
ldap_pvt_thread_mutex_lock(&cm->remove_mutex);
while (query && (query->expiry_time < curr_time)) {
ldap_pvt_thread_mutex_lock(&qm->lru_mutex);
remove_query(qm, query);
ldap_pvt_thread_mutex_unlock(&qm->lru_mutex);
for(;;) {
ldap_pvt_thread_sleep(cm->cc_period);
for (i=0; qm->templates[i].querystr; i++) {
templ = qm->templates + i;
query = templ->query_last;
curr_time = slap_get_time();
ldap_pvt_thread_mutex_lock(&cm->remove_mutex);
while (query && (query->expiry_time < curr_time)) {
ldap_pvt_thread_mutex_lock(&qm->lru_mutex);
remove_query(qm, query);
ldap_pvt_thread_mutex_unlock(&qm->lru_mutex);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n",
i, 0, 0 );
LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n",
i, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n",
i, 0, 0 );
Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n",
i, 0, 0 );
#endif /* !NEW_LOGGING */
ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock);
remove_from_template(query, templ);
ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock);
remove_from_template(query, templ);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"TEMPLATE %d QUERIES-- %d\n",
i, templ->no_of_queries, 0 );
LDAP_LOG( BACK_META, DETAIL1,
"TEMPLATE %d QUERIES-- %d\n",
i, templ->no_of_queries, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n",
i, templ->no_of_queries, 0 );
Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n",
i, templ->no_of_queries, 0 );
#endif /* !NEW_LOGGING */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n",
i, 0, 0 );
LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n",
i, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n",
i, 0, 0 );
Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n",
i, 0, 0 );
#endif /* !NEW_LOGGING */
ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock);
uuid.bv_val = query->q_uuid;
uuid.bv_len = strlen(query->q_uuid);
return_val = remove_query_data(op, rs, &uuid, &result);
ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock);
uuid.bv_val = query->q_uuid;
uuid.bv_len = strlen(query->q_uuid);
return_val = remove_query_data(&op, &rs, &uuid, &result);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"STALE QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STALE QUERY REMOVED, SIZE=%d\n",
LDAP_LOG( BACK_META, DETAIL1,
"STALE QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0 );
#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->total_entries -= result.rc;
cm->num_cached_queries--;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
Debug( LDAP_DEBUG_ANY, "STALE QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0 );
#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
cm->cache_size = (return_val > cm->cache_size) ?
0: (cm->cache_size-return_val);
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->total_entries -= result.rc;
cm->num_cached_queries--;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size,
cm->total_entries, 0 );
LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size,
cm->total_entries, 0 );
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
#endif /* !NEW_LOGGING */
query_prev = query;
query = query->prev;
free_query(query_prev);
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
cm->cache_size = (return_val > cm->cache_size) ?
0: (cm->cache_size-return_val);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size,
cm->total_entries, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size,
cm->total_entries, 0 );
#endif /* !NEW_LOGGING */
query_prev = query;
query = query->prev;
free_query(query_prev);
}
ldap_pvt_thread_mutex_unlock(&cm->remove_mutex);
}
ldap_pvt_thread_mutex_unlock(&cm->remove_mutex);
}
op->o_bd = be;
}
static int
@ -1738,32 +1744,42 @@ cache_back_sentry(
SlapReply *rs )
{
slap_callback *cb = op->o_callback;
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
/*struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;*/
Backend* be = (Backend*)(cb->sc_private);
struct metainfo *li = ( struct metainfo * )be->be_private;
char *ename = NULL;
struct exception result;
struct berval dn;
struct berval ndn;
dn = rs->sr_entry->e_name;
ndn = rs->sr_entry->e_nname;
rewriteSession( li->rwinfo, "cacheReturn",
rs->sr_entry->e_name.bv_val, op->o_conn,
&ename, &result );
ber_str2bv(ename, strlen(ename), 0, &rs->sr_entry->e_name);
/* FIXME: should we normalize this? */
ber_dupbv(&rs->sr_entry->e_nname, &rs->sr_entry->e_name);
op->o_callback = NULL;
send_search_entry( op, rs );
rs->sr_entry->e_name = dn;
rs->sr_entry->e_nname = ndn;
if (rs->sr_type == REP_SEARCH) {
dn = rs->sr_entry->e_name;
ndn = rs->sr_entry->e_nname;
op->o_callback = cb;
rewriteSession( li->rwinfo, "cacheReturn",
rs->sr_entry->e_name.bv_val, op->o_conn,
&ename, &result );
ber_str2bv(ename, strlen(ename), 0, &rs->sr_entry->e_name);
/* FIXME: should we normalize this? */
ber_dupbv(&rs->sr_entry->e_nname, &rs->sr_entry->e_name);
return 0;
op->o_callback = NULL;
send_search_entry( op, rs );
rs->sr_entry->e_name = dn;
rs->sr_entry->e_nname = ndn;
op->o_callback = cb;
return 0;
} else if (rs->sr_type == REP_RESULT) {
op->o_callback = NULL;
send_ldap_result( op, rs );
return 0;
}
return -1;
}
#endif

View file

@ -141,12 +141,13 @@ typedef struct cache_manager_s {
int num_entries_limit; /* max # of entries in a cacheable query */
int threads; /* number of threads currently in meta_back_search */
int consistency_cycle_time; /* interval between successive consistency checks (sec) */
int consistency_time; /* time when consistency check was last performed (sec) */
int cc_period; /* interval between successive consistency checks (sec) */
int cc_thread_started;
ldap_pvt_thread_t cc_thread;
ldap_pvt_thread_mutex_t cache_mutex;
ldap_pvt_thread_mutex_t remove_mutex;
ldap_pvt_thread_mutex_t consistency_mutex;
ldap_pvt_thread_mutex_t cc_mutex;
query_manager* qm; /* query cache managed by the cache manager */
} cache_manager;

View file

@ -171,8 +171,8 @@ meta_back_db_init(
cm->total_entries = 0;
cm->max_queries = 10000;
cm->threads = 0;
cm->consistency_time = slap_get_time();
cm->consistency_cycle_time = 1000;
cm->cc_thread_started = 0;
cm->cc_period = 1000;
qm->attr_sets = NULL;
qm->templates = NULL;
@ -186,7 +186,7 @@ meta_back_db_init(
ldap_pvt_thread_mutex_init(&cm->cache_mutex);
ldap_pvt_thread_mutex_init(&cm->remove_mutex);
ldap_pvt_thread_mutex_init( &cm->consistency_mutex );
ldap_pvt_thread_mutex_init( &cm->cc_mutex );
#endif /* LDAP_CACHING */
li = ch_calloc( 1, sizeof( struct metainfo ) );