Hi Shawn No affense to your work,I am still confusing about the cache warm processing about your explanation.So I check the warm method of FastLRUCache as [1]. As far as I see,there is no values refresh during the the warm processing. the *regenerator.regenerateItem* just put the old value to the new cache.
Did I miss anything? [1]------------------------------------------------------------------------------ public void warm(SolrIndexSearcher searcher, SolrCache old) { if (regenerator == null) return; long warmingStartTime = System.nanoTime(); FastLRUCache other = (FastLRUCache) old; // warm entries if (isAutowarmingOn()) { int sz = autowarm.getWarmCount(other.size()); Map items = other.cache.getLatestAccessedItems(sz); Map.Entry[] itemsArr = new Map.Entry[items.size()]; int counter = 0; for (Object mapEntry : items.entrySet()) { itemsArr[counter++] = (Map.Entry) mapEntry; } for (int i = itemsArr.length - 1; i >= 0; i--) { try { boolean continueRegen = regenerator.regenerateItem(searcher, this, old, itemsArr[i].getKey(), itemsArr[i].getValue()); if (!continueRegen) break; } catch (Exception e) { SolrException.log(log, "Error during auto-warming of key:" + itemsArr[i].getKey(), e); } } } warmupTime = TimeUnit.MILLISECONDS.convert(System.nanoTime() - warmingStartTime, TimeUnit.NANOSECONDS); } 2014-07-25 21:45 GMT+08:00 Shawn Heisey <s...@elyograg.org>: > On 7/24/2014 8:45 PM, YouPeng Yang wrote: > > To Matt > > > > Thank you,your opinion is very valuable ,So I have checked the source > > codes about how the cache warming up. It seems to just put items of the > > old caches into the new caches. > > I will pull Mark Miller into this discussion.He is the one of the > > developer of the Solr whom I had contacted with. > > > > To Mark Miller > > > > Would you please check out what we are discussing in the last two > > posts.I need your help. > > Matt is completely right. Any commit can drastically change the Lucene > document id numbers. It would be too expensive to determine which > numbers haven't changed. That means Solr must throw away all cache > information on commit. > > Two of Solr's caches support autowarming. Those caches use queries as > keys and results as values. Autowarming works by re-executing the top N > queries (keys) in the old cache to obtain fresh Lucene document id > numbers (values). The cache code does take *keys* from the old cache > for the new cache, but not *values*. I'm very sure about this, as I > wrote the current (and not terribly good) LFUCache. > > Thanks, > Shawn > >