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

Add shareSchema leak protections



    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Schema and Analysis
    • None


      The shareSchema option in solr.xml allows cores to share a common IndexSchema, assuming the underlying schema is literally the same (from the same configSet). However this sharing has no protections to prevent an IndexSchema from accidentally referencing the SolrCore and its settings. The effect might be nondeterministic behavior depending on which core loaded the schema first, or the effect might be a memory leak preventing a closed SolrCore from GC'ing, or maybe an error. Example:

      • IndexSchema could theoretically do property expansion using the core's props, such as solr.core.name, silly as that may be.
      • IndexSchema uses the same SolrResourceLoader for the core, which in turn tracks infoMBeans and other things that can refer to the core. It should probably have it's own SolrResourceLoader but it's not trivial; there are complications with life-cycle of ResourceLoaderAware tracking etc.
      • If anything in IndexSchema is SolrCoreAware, this isn't going to work!
        • SchemaSimilarityFactory is SolrCoreAware, though I think it could be reduced to being SchemaAware and work.
        • ExternalFileField is currently SchemaAware it grabs the SolrResourceLoader to call getDataDir which is bad.  FYI In a separate PR I'm removing getDataDir from SRL.
        • Should probably fail if anything is detected.


        Issue Links



              Unassigned Unassigned
              dsmiley David Smiley
              0 Vote for this issue
              4 Start watching this issue