Solr
  1. Solr
  2. SOLR-1981

solr.xml should fail to load if multiple cores with the same name

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      As noted in email a while back...

      http://search.lucidimagination.com/search/document/674bf5dfbbb349bc/multiple_cores_w_same_name_in_solr_xml

      but there is currently no assertion that every core have a name, or that the
      names be unique before the SolrCore is constructed ... it's not until the core is registered that an error will be
      generated if the core name is null, or that the previous core with an identicle name will be close()ed.

      I think we should fail fast if solr.xml specifies the same name more then once

      1. SOLR-1981.patch
        2 kB
        Hoss Man
      2. SOLR-1981.patch
        2 kB
        Hoss Man

        Activity

        Hide
        Hoss Man added a comment -

        patch I had sitting on my hard drive that tries to deal with this better.

        Show
        Hoss Man added a comment - patch I had sitting on my hard drive that tries to deal with this better.
        Hide
        Hoss Man added a comment -

        Note: what i'm propossing here actually breaks back-compat in a way that i think is good.

        at the moment, if you declare multiple cores with the exact same name, solr will initialize the first, then initialize the second, which will shutdown the first – in effect, silently ignoring the first declaration.

        I'm proposing a hard failure during solr.xml config parsing, before any SolrCores are ever initialized.

        Show
        Hoss Man added a comment - Note: what i'm propossing here actually breaks back-compat in a way that i think is good. at the moment, if you declare multiple cores with the exact same name, solr will initialize the first, then initialize the second, which will shutdown the first – in effect, silently ignoring the first declaration. I'm proposing a hard failure during solr.xml config parsing, before any SolrCores are ever initialized.
        Hide
        Mark Miller added a comment -

        +1 - lets do it

        Show
        Mark Miller added a comment - +1 - lets do it
        Hide
        Hoss Man added a comment -

        aparently i never actually tested that patch when i wrote it – i just discovered that it breaks everything because i removed the 'name=""' that happens for hte default core.

        new patch adds that back, along with a comment about why it's there, and includes a new check to ensure that name is always specified (no NPE if it's missing)

        Show
        Hoss Man added a comment - aparently i never actually tested that patch when i wrote it – i just discovered that it breaks everything because i removed the 'name=""' that happens for hte default core. new patch adds that back, along with a comment about why it's there, and includes a new check to ensure that name is always specified (no NPE if it's missing)
        Hide
        Hoss Man added a comment -

        Committed revision 962714. ... trunk

        Committed revision 962721. ... branch 3x

        Show
        Hoss Man added a comment - Committed revision 962714. ... trunk Committed revision 962721. ... branch 3x
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release

          People

          • Assignee:
            Hoss Man
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development