Details
-
Task
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
SolrCore.getCoreDescriptor() surprisingly must do coreContainer.getCoreDescriptor(name) instead of simply return a field on itself. I think it's more sane that a SolrCore hold onto its own descriptor making it unequivocally clear it will get it. I've seen a transient-core edge case where it didn't, though I don't want to classify this issue as a bug fix over that.
Also:
- SolrCore's constructors don't need a "name" since it's guaranteed to always be the name in the coreDescriptor. I checked.
- SolrCore's constructor shouldn't call coreContainer.solrCores.addCoreDescriptor(cd); because it's the container's responsibility to manage such things. I made SolrCores.putCore ensure the descriptor is added, and this is called by CoreContainer.registerCore which is called after new SolrCore instances are created.
- solrCore.setName should only be called when we expect the name to change. Furthermore that shouldn't ever happen in SolrCloud so I added checks.
- solrCore.setName calls coreMetricManager.afterCoreSetName() which is something that is really only related to a rename, not name initialization (from the constructor). I renamed that method and further only call it if the name did change from non-null.
Attachments
Issue Links
- is related to
-
SOLR-10007 Clean up references to CoreContainer and CoreDescriptors
- Closed
- links to