julianchandras opened a new pull request, #5312:
URL: https://github.com/apache/solr/pull/5312

   https://issues.apache.org/jira/browse/SOLR-18632
   
   <!--
   _(If you are a project committer then you may remove some/all of the 
following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system 
for Solr:
   
   * https://issues.apache.org/jira/projects/SOLR
   
   For something minor (i.e. that wouldn't be worth putting in release notes), 
you can skip JIRA.
   To create a Jira issue, you will need to create an account there first.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * SOLR-####: <short description of problem or changes>
   
   SOLR must be fully capitalized. A short description helps people scanning 
pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly 
updated with code review comments and commits. -->
   
   
   # Description
   
   SOLR-16143 fixed collections created from a configset that was deleted and 
re-uploaded under the same name getting the old config, by including the 
znode's ctime in `SolrConfig.ResourceProvider.hash`. Since SOLR-16336, 
`solrconfig.xml` and the schema are both loaded through 
`IndexSchemaFactory.getFromCache`, which only compares znode versions and not 
the computed hash. Since a recreated znode starts again at version 0, the 
versions comparison matches and the  old cached `solrconfig.xml` and schema are 
returned.
   
   # Solution
   
   `IndexSchemaFactory.VersionedConfig` now also stores the znode's ctime, and 
`getFromCache` only reuses a cached entry if both version and ctime match. To 
support this, `ZkSolrResourceLoader.getZkResourceInfo` returns the znode's 
`Stat` instead of only its version, and `SolrConfig.readXml` passes the ctime 
along.
   
   Written with Claude Code
   
   # Tests
   
   Added `testRecreatedConfigSetIsNotServedFromCache` to 
`MultipleManagedSchemasTest`. It creates a collection from `_default`, deletes 
the collection and config set, re-uploads `_default` under the same name with 
an extra request handler and field, and checks that the re-created collection 
has both. It fails on main, where the old `solrconfig.xml` and schema are used, 
and passes with this change. The existing test in that class only checks that 
the second create succeeds, which it does even with the stale config.
   
   Also ran `TestConfigSetsAPI`, `TestConfigSetImmutable`, 
`TestManagedSchemaAPI`, `TestCloudSchemaless`, `TestConfigOverlay` and 
`TestSolrConfigHandler`.
   
   Also written with Claude Code
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to