Repository navigation
SOLR-18632: Recreated configset with the same name is still served from the stale config cache - #5312
Open
julianchandras wants to merge 1 commit into
Open
julianchandras wants to merge 1 commit into
julianchandras wants to merge 1 commit into
Conversation
…om the stale config cache
|
Automated PR triage (LLM-generated; may be wrong). Checked once, when the PR was opened or marked ready; not updated on later pushes. No clear mismatches in the answered judgements.
|
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.
https://issues.apache.org/jira/browse/SOLR-18632
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.xmland the schema are both loaded throughIndexSchemaFactory.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 cachedsolrconfig.xmland schema are returned.Solution
IndexSchemaFactory.VersionedConfignow also stores the znode's ctime, andgetFromCacheonly reuses a cached entry if both version and ctime match. To support this,ZkSolrResourceLoader.getZkResourceInforeturns the znode'sStatinstead of only its version, andSolrConfig.readXmlpasses the ctime along.Written with Claude Code
Tests
Added
testRecreatedConfigSetIsNotServedFromCachetoMultipleManagedSchemasTest. It creates a collection from_default, deletes the collection and config set, re-uploads_defaultunder 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 oldsolrconfig.xmland 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,TestConfigOverlayandTestSolrConfigHandler.Also written with Claude Code
Checklist
Please review the following and check all that apply: