How to split a shard?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to split a shard?

Gael Jourdan-Weil
Hi,

We are trying to split a single shard into two but we are encountering some issues we don't understand.

Our current setup:
- 1 collection "col"
- 1 shard "shard1"
- 2 nodes, each having the whole collection (SolrCloud)
- 1 core on each node "col_core"

What we would like to have is:
- 1 collection "col"
- 2 shards: "shard1" and "shard2"
- 2 nodes, each still having the whole collection, thus the 2 shards (SolrCloud)
- 2 cores on each node: "col_core", "col_core2"

We tried following actions:
A) Create a new core "col_core2", then run the SPLIT (https://lucene.apache.org/solr/guide/7_6/coreadmin-api.html#coreadmin-split)
action to split "col_core" to targetCore "col_core2" but we get the error "Core with core name col_core2 must be the only replica in shard shard2"
B) Run the SPLITSHARD action to split the shard "shard1" into two other shards but we get the error "missing index size information for parent shard leader".

What would be the best approach to do this splitting? And any idea why do we get these errors?

(We are using Solr 7.6.0)

Thanks for reading,
Regards,

Gaël
Reply | Threaded
Open this post in threaded view
|

Re: How to split a shard?

Shawn Heisey-2
On 9/26/2019 8:50 AM, Gael Jourdan-Weil wrote:
> We are trying to split a single shard into two but we are encountering some issues we don't understand.

<snip>

> A) Create a new core "col_core2", then run the SPLIT (https://lucene.apache.org/solr/guide/7_6/coreadmin-api.html#coreadmin-split)

If you are running SolrCloud, do NOT use the CoreAdmin API.  Use of the
CoreAdmin API on SolrCloud will lead to problems.

Use the Collections API only.

https://lucene.apache.org/solr/guide/7_6/collections-api.html#splitshard

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

RE: How to split a shard?

Gael Jourdan-Weil
Thanks for your answer Shawn, let's use the Collections API only then :)

Any idea what could cause the "missing index size information for parent shard leader" error message?

Regards,
Gaël
________________________________
De : Shawn Heisey <[hidden email]>
Envoyé : jeudi 26 septembre 2019 16:58
À : [hidden email] <[hidden email]>
Objet : Re: How to split a shard?

On 9/26/2019 8:50 AM, Gael Jourdan-Weil wrote:
> We are trying to split a single shard into two but we are encountering some issues we don't understand.

<snip>

> A) Create a new core "col_core2", then run the SPLIT (https://lucene.apache.org/solr/guide/7_6/coreadmin-api.html#coreadmin-split)

If you are running SolrCloud, do NOT use the CoreAdmin API.  Use of the
CoreAdmin API on SolrCloud will lead to problems.

Use the Collections API only.

https://lucene.apache.org/solr/guide/7_6/collections-api.html#splitshard

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

RE: How to split a shard?

Gael Jourdan-Weil
FYI, I succeeded at using SPLITSHARD operation after renaming my core.

My core was named the same as the collection name and the split shard operation was looking for a metric with key "solr.core.collectionName.shard1.null" while the metrics available for the core was with key "solr.core.collectionName.shard1.core_nodeNN".
I renamed my core (with Core API on all nodes) to something like "<collectionName>_shard1", and then both metrics keys and SPLITSHARD keys computation was the same and it allowed SPLITSHARD operation to work.

Relevant part of the SPLITSHARD command code is at https://github.com/apache/lucene-solr/blob/e7522297a70674662f1083f9942403bac3119693/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java#L156 and https://github.com/apache/lucene-solr/blob/e7522297a70674662f1083f9942403bac3119693/solr/solrj/src/java/org/apache/solr/common/util/Utils.java#L648.
We are assuming that a core is named like "collection1_shard1_1_replica1" or at least starts with the same name as the collection + other characters.
=> Is this assumption really correct?

Maybe it's due to some legacy stuff on our side but the name of our cores is manually chosen with core.properties file and AFAIK It's never mentionned anywhere that cores should have a particular name.

Regards,
Gaël

________________________________
De : Gael Jourdan-Weil <[hidden email]>
Envoyé : jeudi 26 septembre 2019 17:57
À : [hidden email] <[hidden email]>
Objet : RE: How to split a shard?

Thanks for your answer Shawn, let's use the Collections API only then :)

Any idea what could cause the "missing index size information for parent shard leader" error message?

Regards,
Gaël
________________________________
De : Shawn Heisey <[hidden email]>
Envoyé : jeudi 26 septembre 2019 16:58
À : [hidden email] <[hidden email]>
Objet : Re: How to split a shard?

On 9/26/2019 8:50 AM, Gael Jourdan-Weil wrote:
> We are trying to split a single shard into two but we are encountering some issues we don't understand.

<snip>

> A) Create a new core "col_core2", then run the SPLIT (https://lucene.apache.org/solr/guide/7_6/coreadmin-api.html#coreadmin-split)

If you are running SolrCloud, do NOT use the CoreAdmin API.  Use of the
CoreAdmin API on SolrCloud will lead to problems.

Use the Collections API only.

https://lucene.apache.org/solr/guide/7_6/collections-api.html#splitshard

Thanks,
Shawn