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 Manohar Sripada <ma...@gmail.com> on 2017/04/18 15:03:08 UTC

How to change stateFomat to 2

After deleting a collection through Collection API, the data is not getting
deleted from clusterstate.json. Based on this discussion
<http://lucene.472066.n3.nabble.com/create-collection-gets-stuck-on-node-restart-td4311994.html>,
it seems clusterstate.json shouldn't be there for Solr 5.x (I am using
5.2.1). It also mentions that stateFormat should be set to 2.

How to set stateFormat to 2 while calling the Collection API? Can I default
it to 2 during the setup itself so that I dont need to set it up for each
and every collection creation?

Thanks in Advance!

Re: How to change stateFomat to 2

Posted by Erick Erickson <er...@gmail.com>.
There should be no need to set CLUSTERPROP more than once, it's a
characteristic of your entire, well, cluster. See clusterprops.json in
your admin UI>>tree view.

Best,
Erick

On Tue, Apr 18, 2017 at 10:21 AM, Manohar Sripada <ma...@gmail.com> wrote:
> Thanks Erick!
> state.json exists for each collection in the "tree" view of admin UI. So,
> that format is set to 2. I will call the CLUSTERPROP collections API too
> and set legacyCloud=false whenever I create a collection.
>
> Thanks
>
> On Tue, Apr 18, 2017 at 8:50 PM, Erick Erickson <er...@gmail.com>
> wrote:
>
>> clusterstate.json will exist, it just should be empty if you're using
>> state format 2.
>>
>> Note: if you have "state.json" files under each collections in ZK (see
>> the "tree" view in the admin UI), then you _are_ in the format 2
>> world. However, for Solr 5.x, there'a an obscure property
>> "legacyCloud" that, if true will allow orphan replicas to reconstruct
>> themselves in clusterstate.json even if the format is 2. The condition
>> is that you have orphan replicas out there (where you've deleted the
>> collection but for some reason were unable to delete the replica, say
>> the Solr node hosting some replicas was down and you restarted it).
>> When Solr starts up, this orphan reconstructs itself in
>> clusterstate.json, where it's ignored.
>>
>> So you should set legacyCloud=false using the CLUSTERPROP (IIRC)
>> collections API call. You can also just delete the _data_ from
>> clusterstate.json. ASSUMING you're in format 2.
>>
>> If you're really in format 1, then see MIGRATESTATEFORMAT here:
>> https://cwiki.apache.org/confluence/display/solr/Collections+API#
>> CollectionsAPI-MIGRATESTATEFORMAT:MigrateClusterState
>>
>> Best,
>> Erick
>>
>> On Tue, Apr 18, 2017 at 8:03 AM, Manohar Sripada <ma...@gmail.com>
>> wrote:
>> > After deleting a collection through Collection API, the data is not
>> getting
>> > deleted from clusterstate.json. Based on this discussion
>> > <http://lucene.472066.n3.nabble.com/create-collection-
>> gets-stuck-on-node-restart-td4311994.html>,
>> > it seems clusterstate.json shouldn't be there for Solr 5.x (I am using
>> > 5.2.1). It also mentions that stateFormat should be set to 2.
>> >
>> > How to set stateFormat to 2 while calling the Collection API? Can I
>> default
>> > it to 2 during the setup itself so that I dont need to set it up for each
>> > and every collection creation?
>> >
>> > Thanks in Advance!
>>

Re: How to change stateFomat to 2

Posted by Manohar Sripada <ma...@gmail.com>.
Thanks Erick!
state.json exists for each collection in the "tree" view of admin UI. So,
that format is set to 2. I will call the CLUSTERPROP collections API too
and set legacyCloud=false whenever I create a collection.

Thanks

On Tue, Apr 18, 2017 at 8:50 PM, Erick Erickson <er...@gmail.com>
wrote:

> clusterstate.json will exist, it just should be empty if you're using
> state format 2.
>
> Note: if you have "state.json" files under each collections in ZK (see
> the "tree" view in the admin UI), then you _are_ in the format 2
> world. However, for Solr 5.x, there'a an obscure property
> "legacyCloud" that, if true will allow orphan replicas to reconstruct
> themselves in clusterstate.json even if the format is 2. The condition
> is that you have orphan replicas out there (where you've deleted the
> collection but for some reason were unable to delete the replica, say
> the Solr node hosting some replicas was down and you restarted it).
> When Solr starts up, this orphan reconstructs itself in
> clusterstate.json, where it's ignored.
>
> So you should set legacyCloud=false using the CLUSTERPROP (IIRC)
> collections API call. You can also just delete the _data_ from
> clusterstate.json. ASSUMING you're in format 2.
>
> If you're really in format 1, then see MIGRATESTATEFORMAT here:
> https://cwiki.apache.org/confluence/display/solr/Collections+API#
> CollectionsAPI-MIGRATESTATEFORMAT:MigrateClusterState
>
> Best,
> Erick
>
> On Tue, Apr 18, 2017 at 8:03 AM, Manohar Sripada <ma...@gmail.com>
> wrote:
> > After deleting a collection through Collection API, the data is not
> getting
> > deleted from clusterstate.json. Based on this discussion
> > <http://lucene.472066.n3.nabble.com/create-collection-
> gets-stuck-on-node-restart-td4311994.html>,
> > it seems clusterstate.json shouldn't be there for Solr 5.x (I am using
> > 5.2.1). It also mentions that stateFormat should be set to 2.
> >
> > How to set stateFormat to 2 while calling the Collection API? Can I
> default
> > it to 2 during the setup itself so that I dont need to set it up for each
> > and every collection creation?
> >
> > Thanks in Advance!
>

Re: How to change stateFomat to 2

Posted by Erick Erickson <er...@gmail.com>.
clusterstate.json will exist, it just should be empty if you're using
state format 2.

Note: if you have "state.json" files under each collections in ZK (see
the "tree" view in the admin UI), then you _are_ in the format 2
world. However, for Solr 5.x, there'a an obscure property
"legacyCloud" that, if true will allow orphan replicas to reconstruct
themselves in clusterstate.json even if the format is 2. The condition
is that you have orphan replicas out there (where you've deleted the
collection but for some reason were unable to delete the replica, say
the Solr node hosting some replicas was down and you restarted it).
When Solr starts up, this orphan reconstructs itself in
clusterstate.json, where it's ignored.

So you should set legacyCloud=false using the CLUSTERPROP (IIRC)
collections API call. You can also just delete the _data_ from
clusterstate.json. ASSUMING you're in format 2.

If you're really in format 1, then see MIGRATESTATEFORMAT here:
https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-MIGRATESTATEFORMAT:MigrateClusterState

Best,
Erick

On Tue, Apr 18, 2017 at 8:03 AM, Manohar Sripada <ma...@gmail.com> wrote:
> After deleting a collection through Collection API, the data is not getting
> deleted from clusterstate.json. Based on this discussion
> <http://lucene.472066.n3.nabble.com/create-collection-gets-stuck-on-node-restart-td4311994.html>,
> it seems clusterstate.json shouldn't be there for Solr 5.x (I am using
> 5.2.1). It also mentions that stateFormat should be set to 2.
>
> How to set stateFormat to 2 while calling the Collection API? Can I default
> it to 2 during the setup itself so that I dont need to set it up for each
> and every collection creation?
>
> Thanks in Advance!