Markus Jelsma created SOLR-8941:
-----------------------------------

             Summary: CoreAdminApi does not automatically recreate 
core.properties
                 Key: SOLR-8941
                 URL: https://issues.apache.org/jira/browse/SOLR-8941
             Project: Solr
          Issue Type: Bug
    Affects Versions: 5.5.1
            Reporter: Markus Jelsma
             Fix For: master


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

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



Then i recreate the core:

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

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:
{code}
#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
{code}

This is after unloading and recreating:

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to