You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by 汤林 <ta...@gmail.com> on 2015/01/23 03:10:59 UTC

In a SolrCloud, will a solr core(shard replica) failover to its good peer when its state is not Active

A solr core have several state, besides "Active", there are "Recovering",
"Down", "Recovery failed" and "Gone".
I know when the state is Recovering, the query or index request can be
failover to its leader(the good one), but I'm not sure other state,
especially the "Down" state at the solr server just starting period.

Could anyone help to confirm? Thanks!

Re: In a SolrCloud, will a solr core(shard replica) failover to its good peer when its state is not Active

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/22/2015 11:28 PM, 汤林 wrote:
> From a testing aspect, if we would like to verify the case that a query
> request to a "down" core on a running server will be failed over to the
> good core on another running server, is there any way to make a core as
> "down" on a running server? Thanks!

I think that would depend on exactly why the core is down.  Most
failures will make the core nonexistent in Solr, thus unable to accept
queries, but if you have a problem that results in the core functioning
correctly but the cluster is unaware of that fact, then the query would
probably work.  That kind of failure shouldn't be possible, but all
software has bugs, so I'm not going to rule it out.

> We tried to change the /clusterstate.json in ZooKeeper to mark an "active"
> core as "down", but it seems only change the state in ZK, while the core
> still functions in solr server.

I have no idea what will happen with manual clusterstate manipulation.
Although I do have a small cloud install, it's running an ancient
version (4.2.1), has no sharded indexes, and I do not interact with it
on a regular basis.

Thanks,
Shawn


Re: In a SolrCloud, will a solr core(shard replica) failover to its good peer when its state is not Active

Posted by 汤林 <ta...@gmail.com>.
Thanks, Erick.

>From a testing aspect, if we would like to verify the case that a query
request to a "down" core on a running server will be failed over to the
good core on another running server, is there any way to make a core as
"down" on a running server? Thanks!

We tried to change the /clusterstate.json in ZooKeeper to mark an "active"
core as "down", but it seems only change the state in ZK, while the core
still functions in solr server.

2015-01-23 12:18 GMT+08:00 Erick Erickson <er...@gmail.com>:

> In a word, yes. As far as querying is concerned, there is only "Active"
> and "all other states", and
> requests are only routed to replicas in the "Active" state.
>
> Best,
> Erick
>
> On Thu, Jan 22, 2015 at 6:34 PM, 汤林 <ta...@gmail.com> wrote:
>
>> Thanks, Erick.
>>
>> You are right. My question is : When a Solr server is running, but a
>> core(shard replica) on it is NOT "Active", for example, "Down", will the
>> query request to it be failed over to the good replica of the same shard?
>> Thanks!
>>
>> 2015-01-23 10:26 GMT+08:00 Erick Erickson <er...@gmail.com>:
>>
>>> As long as one replica for each shard is "active", you should be able to
>>> query the collection.
>>>
>>> You an also index to the collection and it'll all "just work", when the
>>> replicas that are not active become active they'll get the updates and
>>> catch up to the leader. This process may take quite some time so it is
>>> probably best, if you have a choice, to turn indexing on after all the
>>> replicas are up and running. This is not a requirement, however.
>>>
>>> Best,
>>> Erick
>>>
>>> On Thu, Jan 22, 2015 at 6:10 PM, 汤林 <ta...@gmail.com> wrote:
>>>
>>>> A solr core have several state, besides "Active", there are
>>>> "Recovering",
>>>> "Down", "Recovery failed" and "Gone".
>>>> I know when the state is Recovering, the query or index request can be
>>>> failover to its leader(the good one), but I'm not sure other state,
>>>> especially the "Down" state at the solr server just starting period.
>>>>
>>>> Could anyone help to confirm? Thanks!
>>>>
>>>
>>>
>>
>

Re: In a SolrCloud, will a solr core(shard replica) failover to its good peer when its state is not Active

Posted by 汤林 <ta...@gmail.com>.
Thanks, Erick.

You are right. My question is : When a Solr server is running, but a
core(shard replica) on it is NOT "Active", for example, "Down", will the
query request to it be failed over to the good replica of the same shard?
Thanks!

2015-01-23 10:26 GMT+08:00 Erick Erickson <er...@gmail.com>:

> As long as one replica for each shard is "active", you should be able to
> query the collection.
>
> You an also index to the collection and it'll all "just work", when the
> replicas that are not active become active they'll get the updates and
> catch up to the leader. This process may take quite some time so it is
> probably best, if you have a choice, to turn indexing on after all the
> replicas are up and running. This is not a requirement, however.
>
> Best,
> Erick
>
> On Thu, Jan 22, 2015 at 6:10 PM, 汤林 <ta...@gmail.com> wrote:
>
>> A solr core have several state, besides "Active", there are "Recovering",
>> "Down", "Recovery failed" and "Gone".
>> I know when the state is Recovering, the query or index request can be
>> failover to its leader(the good one), but I'm not sure other state,
>> especially the "Down" state at the solr server just starting period.
>>
>> Could anyone help to confirm? Thanks!
>>
>
>

Re: In a SolrCloud, will a solr core(shard replica) failover to its good peer when its state is not Active

Posted by Erick Erickson <er...@gmail.com>.
As long as one replica for each shard is "active", you should be able to
query the collection.

You an also index to the collection and it'll all "just work", when the
replicas that are not active become active they'll get the updates and
catch up to the leader. This process may take quite some time so it is
probably best, if you have a choice, to turn indexing on after all the
replicas are up and running. This is not a requirement, however.

Best,
Erick

On Thu, Jan 22, 2015 at 6:10 PM, 汤林 <ta...@gmail.com> wrote:

> A solr core have several state, besides "Active", there are "Recovering",
> "Down", "Recovery failed" and "Gone".
> I know when the state is Recovering, the query or index request can be
> failover to its leader(the good one), but I'm not sure other state,
> especially the "Down" state at the solr server just starting period.
>
> Could anyone help to confirm? Thanks!
>