Re: Solr 7.5 DeleteShard not working when all cores are down

2019-03-14 Thread Aroop Ganguly
correction:

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 leaderless 
shards with all replicas inactive in state.

> On Mar 14, 2019, at 8:01 PM, Aroop Ganguly  wrote:
> 
> 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.



Re: Solr 7.5 DeleteShard not working when all cores are down

2019-03-14 Thread Shalin Shekhar Mangar
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  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=x=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.",
>
> 
>
> > 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.


Re: Solr 7.5 DeleteShard not working when all cores are down

2019-03-14 Thread Shawn Heisey

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=x=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.",




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


Solr 7.5 DeleteShard not working when all cores are down

2019-03-14 Thread Aroop Ganguly
Hi All

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=x=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.",
  "exception":{
"msg":"The slice: shard35 is currently active. Only non-active (or 
custom-hashed) slices can be deleted.",
"rspCode":400},
  "error":{
"metadata":[
  "error-class","org.apache.solr.common.SolrException",
  "root-error-class","org.apache.solr.common.SolrException"],
"msg":"The slice: shard84 is currently active. Only non-active (or 
custom-hashed) slices can be deleted.",
"code":400}}


Why is this api thinking this slice is active ? When the Solr UI shows all 
replicas down ?



Thanks
Aroop