You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Shrey Narayan (Jira)" <ji...@apache.org> on 2026/08/26 13:13:00 UTC
[jira] [Comment Edited] (SOLR-18350) Many callers of org.apache.solr.core.SolrCore#getLatestSchema should use alternatives
[ https://issues.apache.org/jira/browse/SOLR-18350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108303#comment-18108303 ]
Shrey Narayan edited comment on SOLR-18350 at 8/26/26 1:12 PM:
---------------------------------------------------------------
I’ve completed and pushed the SOLR-18350 implementation as commit [{{87d6dee889}}|https://github.com/NextbrickInc/solr/commit/87d6dee8899edb71a4f9e6f2fb9f05c8058da608].
The patch replaces inappropriate {{SolrCore#getLatestSchema()}} calls with schema accessors tied to the active request or searcher:
* Uses {{SolrQueryRequest#getSchema()}} for request-scoped processing.
* Uses {{SolrIndexSearcher#getSchema()}} for searcher-scoped processing.
* Documents the preferred alternatives in the {{getLatestSchema()}} Javadocs.
* Preserves genuinely live-schema paths, including schema mutation, initialization, lifecycle, and managed-resource handling.
* Updates the affected Mockito fixture.
Verification:
* 181 focused Solr core tests passed.
* 88 language-model tests passed.
* Formatting and affected-module checks passed.
* {{git diff --check}} passed.
The patch changes 16 files and removes 36 inappropriate {{getLatestSchema()}} references.
Pull request: [apache/solr#4817|https://github.com/apache/solr/pull/4817]
The pull request is ready for review, open, and mergeable. It currently has no review comments. The pull-request labeler passed; the remaining GitHub Actions workflows are awaiting Apache Solr Commiter approval and have not failed.
[^SOLR-18350_Technical_Brief_NextBricks_Ready_For_Review Shrey Narayan.pdf]
was (Author: JIRAUSER314415):
I’ve completed and pushed the SOLR-18350 implementation as commit [{{87d6dee889}}|https://github.com/NextbrickInc/solr/commit/87d6dee8899edb71a4f9e6f2fb9f05c8058da608].
The patch replaces inappropriate {{SolrCore#getLatestSchema()}} calls with schema accessors tied to the active request or searcher:
* Uses {{SolrQueryRequest#getSchema()}} for request-scoped processing.
* Uses {{SolrIndexSearcher#getSchema()}} for searcher-scoped processing.
* Documents the preferred alternatives in the {{getLatestSchema()}} Javadocs.
* Preserves genuinely live-schema paths, including schema mutation, initialization, lifecycle, and managed-resource handling.
* Updates the affected Mockito fixture.
Verification:
* 181 focused Solr core tests passed.
* 88 language-model tests passed.
* Formatting and affected-module checks passed.
* {{git diff --check}} passed.
The patch changes 16 files and removes 36 inappropriate {{getLatestSchema()}} references.
Pull request: [apache/solr#4817|https://github.com/apache/solr/pull/4817]
The pull request is ready for review, open, and mergeable. It currently has no review comments. The pull-request labeler passed; the remaining GitHub Actions workflows are awaiting Apache Solr Commiter approval and have not failed.
> Many callers of org.apache.solr.core.SolrCore#getLatestSchema should use alternatives
> -------------------------------------------------------------------------------------
>
> Key: SOLR-18350
> URL: https://issues.apache.org/jira/browse/SOLR-18350
> Project: Solr
> Issue Type: Bug
> Reporter: David Smiley
> Priority: Minor
> Labels: newdev, pull-request-available
> Attachments: SOLR-18350_Technical_Brief_NextBricks_Ready_For_Review Shrey Narayan.pdf
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> SolrCore.getLatestSchema can be updated at any time if a schema mutation happens. On the other hand, the SolrQueryRequest has a cached/stable value. A SolrIndexSearcher also has a cached/stable value. Code that needs the schema that _already_ has access to either of those in scope should use them to get the schema, *not* via the core. The javadocs of {{SolrCore.getLatestSchema}} should advise about this.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org