Skip to content

Commit

Permalink
SOLR-17349: SolrDocumentFetcher should always skip lazy field loading…
Browse files Browse the repository at this point in the history
… overhead if documentCache==null (#2535)
  • Loading branch information
magibney authored Jun 26, 2024
1 parent 502faf2 commit 390c30f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ Optimizations
stored field state, reducing heap usage especially for high-core-count, high-field-count, high-thread-count
cases (Vinayak Hegde, Christine Poerschke, Kevin Risden, David Smiley, Michael Gibney)

* SOLR-17349: SolrDocumentFetcher should always skip lazy field loading overhead if documentCache==null (Michael Gibney)

Bug Fixes
---------------------
* SOLR-12813: subqueries should respect basic auth. (Rudy Seitz via Eric Pugh)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,15 @@ private class SolrDocumentStoredFieldVisitor extends DocumentStoredFieldVisitor
super(toLoad);
this.docId = docId;
this.doc = getDocument();
this.lazyFieldProducer =
toLoad != null && enableLazyFieldLoading ? new LazyDocument(reader, docId) : null;
this.addLargeFieldsLazily = (documentCache != null && !largeFields.isEmpty());
if (documentCache == null) {
// lazy loading makes no sense if we don't have a `documentCache`
this.lazyFieldProducer = null;
this.addLargeFieldsLazily = false;
} else {
this.lazyFieldProducer =
toLoad != null && enableLazyFieldLoading ? new LazyDocument(reader, docId) : null;
this.addLargeFieldsLazily = !largeFields.isEmpty();
}
// TODO can we return Status.STOP after a val is loaded and we know there are no other fields
// of interest?
// When: toLoad is one single-valued field, no lazyFieldProducer
Expand Down

0 comments on commit 390c30f

Please sign in to comment.