Thanks Shalin, Shawn.

I ended up getting guidance from Anshum on this and we did indeed use the 
delete-replica api to delete all but one of the replicas, and bouncing the last 
replica  to let it lead.

I will let anshum share a post on the details of how to recover leader shards.

> On Mar 14, 2019, at 7:09 PM, Shalin Shekhar Mangar <shalinman...@gmail.com> 
> wrote:
> 
> What Shawn said.
> 
> DeleteShard API is supposed to be used either when using implicit routing
> or when you have compositeId router but the shard has already been split
> and therefore in an inactive state.
> 
> Delete Replica API is what you need if you want to delete an individual
> replica.
> 
> On Fri, Mar 15, 2019 at 12:39 AM Shawn Heisey <apa...@elyograg.org> wrote:
> 
>> On 3/14/2019 12:47 PM, Aroop Ganguly wrote:
>>> I am trying to delete a shard from a collection using the collections
>>> api for the same.
>>> On the solr ui,  all the replicas are in “downed” state.
>>> 
>>> However, when I run the delete shard
>>> 
>> command: 
>> /solr/admin/collections?action=DELETESHARD&collection=x&shard=shard84
>>> I get this exception:
>>> {
>>>   "responseHeader":{
>>>     "status":400,
>>>     "QTime":14},
>>>   "Operation deleteshard caused
>>> 
>> exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
>> 
>>> The slice: shard35 is currently active. Only non-active
>>> (or custom-hashed) slices can be deleted.",
>> 
>> <snip>
>> 
>>> Why is this api thinking this slice is active ? When the Solr UI shows
>>> all replicas down ?
>> 
>> Active means the shard is considered part of the whole collection --
>> included when you run a query, etc.
>> 
>> Even though all replicas are down, the shard is still an active part of
>> the index.  So you can't delete it.
>> 
>> If your collection is typical and has compositeId routing, deleting a
>> shard is really only possible after you have run SPLITSHARD and then you
>> will only be able to delete the original shard that gets split.
>> 
>> Aside from SPLITSHARD, I really have no idea how to mark a shard as
>> inactive, but that will be required before you can delete it.
>> 
>> Thanks,
>> Shawn
>> 
> 
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.

Reply via email to