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

CoreAdminApi does not automatically recreate core.properties correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.5.1
    • 6.0
    • None
    • None

    Description

      Using the core admin API i unload a core that is a replica in a small cloud.

      http://localhost:8983/solr/admin/cores?action=UNLOAD&core=logs_shard1_replica1
      

      Then i recreate the core:

      http://localhost:8983/solr/admin/cores?action=CREATE&collection=logs&shard=shard1&name=logs_shard1_replica1&core=logs_shard1_replica1
      

      I would assume recreating it and adding it to an existing collection, would automatically also populate the numShards property in core.properties. But it doesn't, and causes NPE with CloudDescriptor.getNumShards() when running custom code.

      I can recreate the core correctly via property.name=value but this is not obvious in the documentation.

      This is core.properties before unloading:

      #Written by CorePropertiesLocator
      #Fri Apr 01 13:07:11 UTC 2016
      numShards=2
      collection.configName=logs
      name=logs_shard1_replica1
      shard=shard1
      collection=logs
      coreNodeName=core_node4
      

      This is after unloading and recreating:

      #Written by CorePropertiesLocator
      #Mon Apr 04 15:42:59 UTC 2016
      name=logs_shard1_replica1
      shard=shard1
      collection=logs
      coreNodeName=core_node4
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            markus17 Markus Jelsma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: