Solr
  1. Solr
  2. SOLR-2691

solr.xml persistence is broken for multicore (by SOLR-2331)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.0-ALPHA
    • Component/s: multicore
    • Labels:
      None

      Description

      With the trunk build, running SolrCloud, if I issue a PERSIST CoreAdmin command,
      the solr.xml gets overwritten with only the last core, repeated as many times
      as there are cores.

      It used to work fine with a trunk build from a couple of months ago, so it looks like
      something broke solr.xml persistence.

      It appears to have been introduced by SOLR-2331:
      CoreContainer#persistFile creates the map for core attributes (coreAttribs) outside
      of the loop that iterates over cores. Therefore, all cores reuse the same map of attributes
      and hence only the values from the last core are preserved and used for all cores in the list.

      I'm running SolrCloud, using:
      -Dbootstrap_confdir=/opt/solr/solr/conf -Dcollection.configName=hcpconf -DzkRun

      I'm starting Solr with four cores listed in solr.xml:

      <solr persistent="true">
      <cores adminPath="/admin/cores" defaultCoreName="master1">
      <core name="master1" instanceDir="master1" shard="shard1" collection="hcpconf" />
      <core name="master2" instanceDir="master2" shard="shard2" collection="hcpconf" />
      <core name="slave1" instanceDir="slave1" shard="shard1" collection="hcpconf" />
      <core name="slave2" instanceDir="slave2" shard="shard2" collection="hcpconf" />
      </cores>
      </solr>

      I then issue a PERSIST request:
      http://localhost:8983/solr/admin/cores?action=PERSIST

      And the solr.xml turns into:

      <solr persistent="true">
      <cores defaultCoreName="master1" adminPath="/admin/cores" zkClientTimeout="10000" hostPort="8983" hostContext="solr">
      <core shard="shard2" instanceDir="slave2/" name="slave2" collection="hcpconf"/>
      <core shard="shard2" instanceDir="slave2/" name="slave2" collection="hcpconf"/>
      <core shard="shard2" instanceDir="slave2/" name="slave2" collection="hcpconf"/>
      <core shard="shard2" instanceDir="slave2/" name="slave2" collection="hcpconf"/>
      </cores>
      </solr>

      1. SOLR-2691.patch
        0.7 kB
        Hoss Man
      2. SOLR-2691.patch
        7 kB
        Hoss Man
      3. jira2691.patch
        0.7 kB
        Yury Kats

        Issue Links

          Activity

          Yury Kats created issue -
          Yury Kats made changes -
          Field Original Value New Value
          Attachment jira2691.patch [ 12489142 ]
          Hoss Man made changes -
          Link This issue is broken by SOLR-2331 [ SOLR-2331 ]
          Mark Miller made changes -
          Assignee Mark Miller [ markrmiller@gmail.com ]
          Fix Version/s 4.0 [ 12314992 ]
          Hoss Man made changes -
          Attachment SOLR-2691.patch [ 12489151 ]
          Hoss Man made changes -
          Attachment SOLR-2691.patch [ 12489203 ]
          Mark Miller made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hoss Man made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Mark Miller made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mark Miller
              Reporter:
              Yury Kats
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development