Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14652

SolrCore should hold its own CoreDescriptor

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.7
    • Component/s: None
    • Labels:
      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

            Activity

              People

              • Assignee:
                dsmiley David Smiley
                Reporter:
                dsmiley David Smiley
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h