Repository navigation
SOLR-13568: Expand component no longer caches per-page group queries in the filter cache - #5014
Open
nick-boss-tech wants to merge 6 commits into
Open
nick-boss-tech wants to merge 6 commits into
nick-boss-tech wants to merge 6 commits into
Conversation
…esults in the test
nick-boss-tech
force-pushed
the
solr-13568-submit
branch
from
October 4, 2026 05:00
e2cf202 to
6b89f64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
https://issues.apache.org/jira/browse/SOLR-13568
What happens today
When paging through expanded groups,
ExpandComponentadds the group query for the current page to the request's filter list. That per-page query is specific to the page being returned and is rarely reused, but it is stored in the filter cache anyway, so paging through expanded results fills the filter cache with one-off entries that evict useful ones.What this change does
The per-page group query is wrapped in a
WrappedQuerywith caching disabled before it is added to the filter list. It still filters the page exactly as before; it is simply no longer stored in the filter cache. No other query's caching behavior changes.Proof
Verified at head ac5d60c on 2026-10-06 (local gate: tidy clean, Error Prone compile clean,
:solr:core:check -x testgreen; first verified at head 6b89f64 on 2026-10-04).TestExpandComponent.testPerPageGroupQueriesNotCachedpages through expanded groups and asserts the per-page group queries do not land in the filter cache. It fails on the base code, where those queries are cached (re-run at ac5d60c: 9 tests, the new test the only failure, filter cache size expected:<3> but was:<5>), and the suite passes here: TestExpandComponent 9/9.A choice to check
This change always keeps the per-page group query out of the filter cache. The alternative is a per-request switch that restores the current caching behavior for requests that ask for it. Always-off is the simpler rule and the cached entries are rarely hit, but if maintainers would rather keep cache hits available for repeated identical page requests, the switch is the route to take.
Limits
Only the expand component's per-page group query is excluded from the filter cache. Any other caller that adds single-use queries to a request's filter list keeps the current caching behavior; that broader pattern is out of scope here. The trade: the same page of the same query, requested again by any user, builds the same group query, and before this change that second request could find the filter in the cache; it now recomputes the group filter every time. For a popular first page that recompute is a real, recurring cost, paid in exchange for the filter cache no longer churning while paging. The cost of running the per-page group query uncached was not benchmarked.
Changelog:
changelog/unreleased/SOLR-13568.yml(type fixed)AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.