From cd0681c4e1c0df62c06f11b27044cbfbab57342e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 17 Aug 2009 13:24:33 +0000 Subject: [PATCH] ITS#6152 restart consistency checker when going back online reset refcnt when refreshing a query --- servers/slapd/overlays/pcache.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; } -- 2.39.5