From: Howard Chu Date: Mon, 17 Aug 2009 13:24:33 +0000 (+0000) Subject: ITS#6152 restart consistency checker when going back online X-Git-Tag: ACLCHECK_0~314 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd0681c4e1c0df62c06f11b27044cbfbab57342e;p=openldap ITS#6152 restart consistency checker when going back online reset refcnt when refreshing a query --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 7f4d861fc6..70d2b97a14 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2809,6 +2809,10 @@ refresh_query( Operation *op, SlapReply *rs, CachedQuery *query, dnlist *dn; int i, rc; + ldap_pvt_thread_mutex_lock( &query->answerable_cnt_mutex ); + query->refcnt = 0; + ldap_pvt_thread_mutex_unlock( &query->answerable_cnt_mutex ); + cb.sc_response = refresh_merge; cb.sc_private = &ri; @@ -3263,6 +3267,15 @@ pc_cf_gen( ConfigArgs *c ) break; case PC_OFFLINE: cm->cc_paused &= ~PCACHE_CC_OFFLINE; + /* If there were cached queries when we went offline, + * restart the checker now. + */ + if ( cm->num_cached_queries ) { + ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); + cm->cc_paused = 0; + ldap_pvt_runqueue_resched( &slapd_rq, cm->cc_arg, 0 ); + ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex ); + } rc = 0; break; }