[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5113) pcache returns incomplete results



On Donnerstag, 6. September 2007, ando@sys-net.it wrote:
> rhafer@suse.de wrote:
> > Hm, current HEAD first calls add_query, which adds the CachedQuery to the
> > cache and after that calls cache_entries to add the entries of that Query
> > to the cache. That means that query_containment already know about the
> > Query before its result is completely cached.
> > In RE23 it is just the other way arround (first cache_entries() then
> > add_query()).
> > I see two possible solution:
> >
> > 1. Switch back to the old behaviour. But I guess the change was made for
> > a reason. I don't know that yet. Seems the change happend between r1.95
> > and r1.96 of pcache.c (log message: "Fix concurrency issues").
> >
> > 2. Protect the cached query with an rw_lock. Writelock it while
> > cache_entries() is executing and readlock it during searches. This would
> > give us the behaviour that Ando suggested in the discussion of ITS#5112.
> > (pcache would not try to cache the same search request mulitple times,
> > but block the second request until the first one is cached and then
> > answer it from the cache)
>
> +1 (if there's no drawback, of course)
The only drawback (if it really is a drawback) is that subsequent clients will 
have to wait for the caching to be completed. Depending on the query that is 
being cached can take pretty long. On the other hand one can also view this 
as an advantage, as it save some network traffic between the proxy that the 
backend-server. :)

-- 
Ralf