You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Christine Poerschke (BLOOMBERG/ LONDON)" <cp...@bloomberg.net> on 2015/07/02 19:15:00 UTC

timeAllowed parameter ignored edge-case bug?

Hello.

Was looking at https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java code to better understand the various getDoc... methods and how collectors are combined.

In the scenario outlined below, the second run's timeAllowed parameter is unexpectedly ignored. Could this be intentionally so somehow (q vs. fq processing?, Collector vs. LeafCollector?, DocList vs. DocSet?), or is it an edge-case bug?

Regards,

Christine

---------------------------

solrconfig characteristics:
 * a queryResultsCache is configured
 * no filterCache is configured

query characteristics:
 * q parameter present
 * at least one fq parameter present
 * sort parameter present (and does not require the score field)
 * GET_DOCSET flag is set e.g. via the StatsComponent i.e. stats=true parameter

runtime characteristics:
 * first run of the query gets a queryResultsCache-miss and respects timeAllowed
 * second run gets a queryResultsCache-hit and ignores timeAllowed (but still
   makes use of the lucene IndexSearcher)

code path execution details (first run):
* SolrIndexSearcher.search calls getDocListC
* getDocListC called queryResultCache.get which found nothing
* getDocListC calls getDocListAndSetNC
* getDocListAndSetNC calls buildAndRunCollectorChain
* buildAndRunCollectorChain constructs TimeLimitingCollector

code path execution details (second run):
* SolrIndexSearcher.search calls getDocListC
* getDocListC called queryResultCache.get which found something
* getDocListC calls getDocSet(List<Query> queries)
* getDocSet(List<Query> queries) iterates over IndexSearcher.leafContexts

Re: timeAllowed parameter ignored edge-case bug?

Posted by Chris Hostetter <ho...@fucit.org>.
: In the scenario outlined below, the second run's timeAllowed parameter 
: is unexpectedly ignored. Could this be intentionally so somehow (q vs. 
: fq processing?, Collector vs. LeafCollector?, DocList vs. DocSet?), or 
: is it an edge-case bug?

Based on your description (didn't re-review the code directly) it sounds 
like an oversight with timeAllowed -- probably overlooked because of the 
oddity of having a queryResultCache but not filterCache (correct me if i'm 
wrong, but it sounds like this bug won't surface if both queryResultsCache 
& filterCache are enabled -- or both disabled -- correct?) ... probably 
doesn't affect (m)any real users because of this.

Sounds like we should split out the "build" part of 
"buildAndRunCollectorChain" into it's own method and re-use it in 
getDocSet (although it seems like that will almost certainly require some 
API changes to propogate the QueryCommand context down)

Christine: can you file this as a Jira so we don't lose track of it?

: 
: Regards,
: 
: Christine
: 
: ---------------------------
: 
: solrconfig characteristics:
:  * a queryResultsCache is configured
:  * no filterCache is configured
: 
: query characteristics:
:  * q parameter present
:  * at least one fq parameter present
:  * sort parameter present (and does not require the score field)
:  * GET_DOCSET flag is set e.g. via the StatsComponent i.e. stats=true parameter
: 
: runtime characteristics:
:  * first run of the query gets a queryResultsCache-miss and respects timeAllowed
:  * second run gets a queryResultsCache-hit and ignores timeAllowed (but still
:    makes use of the lucene IndexSearcher)
: 
: code path execution details (first run):
: * SolrIndexSearcher.search calls getDocListC
: * getDocListC called queryResultCache.get which found nothing
: * getDocListC calls getDocListAndSetNC
: * getDocListAndSetNC calls buildAndRunCollectorChain
: * buildAndRunCollectorChain constructs TimeLimitingCollector
: 
: code path execution details (second run):
: * SolrIndexSearcher.search calls getDocListC
: * getDocListC called queryResultCache.get which found something
: * getDocListC calls getDocSet(List<Query> queries)
: * getDocSet(List<Query> queries) iterates over IndexSearcher.leafContexts
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
: For additional commands, e-mail: dev-help@lucene.apache.org
: 
: 

-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org