Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always(?) use SolrCore.getLatestSchema in RealTimeGetComponent #980

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cpoerschke
Copy link
Contributor

The RealTimeGetComponent uses getLatestSchema in 12 places and getSchema in 2 places.

Intuitively I would expect getSchema to be used throughout since it as per https://github.com/apache/solr/blob/releases/solr/9.0.0/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java#L86-L87 that is snapshot at request creation and so logically cannot change during processing. But based on 12:2 ratio perhaps getLatestSchema is equally suitable?

This pull request is to always use getLatestSchema or to add clarifying comments w.r.t. why some places use one API and others use the other in the component.

@dsmiley
Copy link
Contributor

dsmiley commented Aug 23, 2022

For code activated from a request, I think the code should use a consistent schema for that request. Thus I think RTG should be using req.getSchema() in those 10 places.

@epugh
Copy link
Contributor

epugh commented Aug 23, 2022

I noticed that SpellCheckComponent and QueryElevationComponent also use getLatestSchema... in fact, looking where getLatestSchema (92 times) versus getSchema (173 times) happens is an interesting mish mash of places.

@dsmiley
Copy link
Contributor

dsmiley commented Sep 12, 2022

Let's close this or fundamentally change it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants