Ian Springer created SOLR-18620:
-----------------------------------
Summary: ValueSourceAugmenter: invalid preFetchDocs returns 500;
stale prefetch cache when a context has no DocList
Key: SOLR-18620
URL: https://issues.apache.org/jira/browse/SOLR-18620
Project: Solr
Issue Type: Bug
Components: search
Affects Versions: 10.0, 9.9
Reporter: Ian Springer
SOLR-17775 added prefetching of function values to ValueSourceAugmenter. That
change has three problems:
1. preFetchDocs is read with Integer.parseInt and is never validated.
- preFetchDocs=abc throws a NumberFormatException. SolrReturnFields only
catches SyntaxError, so the request fails with a 500.
- preFetchDocs=-1 causes new int[-1] in setContext, which throws a
NegativeArraySizeException, also a 500.
Both should return 400 BAD_REQUEST.
2. The public constructor now calls qparser.getParam(...). Code that passes a
null QParser used to work, because the parser was only stored, and now gets an
NPE.
3. When setContext gets a context with no DocList (for example from RTG), it
returns before replacing cachedValuesById. If the same transformer instance was
used before, values cached against the earlier searcher can be returned for
docids on the new one.
The existing TestValueSourceAugmenterPrefetchLimit only checks numFound and
score. It never checks the function value itself, so none of these problems are
caught.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]