solr
solr copied to clipboard
SOLR-17304: PKG_VERSIONS not honored when loading the schema plugins
https://issues.apache.org/jira/browse/SOLR-17304
Description
Right now, this is just a reproducer for the issue, and a quick attempt to fix it.
Steps to reproduce
- Upload multiple versions of the same package to Solr (the versions don't have to be compatible with each other)
- Upload a configset which requests a specific package version via PKG_VERSIONS in params.json
- Create a collection using the uploaded configset
Expected behavior
- If the configsets references custom classes from the package, then Solr uses the package version constraint from params.json to initialize all the plugins mentioned in
solrconfig.xml
andschema.xml
Actual behavior
- Solr uses the package version specified in params.json only for loading the
solrconfig.xml
plugins - For
schema.xml
plugins (field types, token filters, similarities, etc.) Solr always goes for the latest available package version, regardless of what was specified in params.json
Why though?
So it looks like when the schema.xml is loaded, and a SolrResourceLoader initializes all schema plugins, the loader isn't able to access the params.json.
The loader keeps a reference to the current SolrConfig which provides access to the params.json, but at the time the schema is loaded that reference is still null.
Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
- [x] I have created a Jira issue and added the issue ID to my pull request title.
- [x] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
- [x] I have developed this patch against the
main
branch. - [x] I have run
./gradlew check
. - [x] I have added tests for my changes.
- [ ] I have added documentation for the Reference Guide